Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ public abstract class AgentHookBase : IAgentHook
{
public abstract string SelfId { get; }

public virtual bool IsMatch(string agentId)
=> string.IsNullOrEmpty(SelfId) || SelfId == agentId;

protected Agent _agent;
public Agent Agent => _agent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public IConversationHook SetConversation(Conversation conversation)
return this;
}

public virtual Task<string> GetConversationIntent()
=> Task.FromResult(string.Empty);

public virtual Task OnStateLoaded(ConversationState state)
=> Task.CompletedTask;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface IConversationHook : IHookBase
/// It will send to the conversation context to help LLM to understand the user's intent.
/// </summary>
/// <returns></returns>
Task<string> GetConversationIntent() => Task.FromResult(string.Empty);
Task<string> GetConversationIntent();

/// <summary>
/// Triggered when listing conversations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ public abstract class InstructHookBase : IInstructHook
{
public abstract string SelfId { get; }

public virtual bool IsMatch(string agentId)
=> string.IsNullOrEmpty(SelfId) || SelfId == agentId;

public virtual async Task BeforeCompletion(Agent agent, RoleDialogModel message)
{
await Task.CompletedTask;
Expand Down
Loading