Files
meeting-assistant/MeetingAssistant/Workflow/WorkflowRulesEditorChatModels.cs
2026-07-01 10:30:28 +02:00

82 lines
2.3 KiB
C#

namespace MeetingAssistant.Workflow;
public enum WorkflowRulesEditorChatRole
{
User,
Agent
}
public sealed record WorkflowRulesEditorChatMessage(
WorkflowRulesEditorChatRole Role,
string Content);
public enum WorkflowRulesEditorConversationItemKind
{
Message,
Activity
}
public sealed record WorkflowRulesEditorConversationItem(
WorkflowRulesEditorConversationItemKind Kind,
WorkflowRulesEditorChatMessage? Message,
string Content,
IReadOnlyList<string>? ActivityLines = null)
{
public bool IsExpanded { get; set; }
public static WorkflowRulesEditorConversationItem ChatMessage(WorkflowRulesEditorChatMessage message)
{
return new WorkflowRulesEditorConversationItem(
WorkflowRulesEditorConversationItemKind.Message,
message,
message.Content);
}
public static WorkflowRulesEditorConversationItem Activity(string content, IReadOnlyList<string> activityLines)
{
return new WorkflowRulesEditorConversationItem(
WorkflowRulesEditorConversationItemKind.Activity,
null,
content,
activityLines);
}
}
public sealed record WorkflowRulesEditorChatResult(string Response);
public enum WorkflowRulesEditorActivityKind
{
Status,
ToolCall,
Thinking
}
public sealed record WorkflowRulesEditorActivityUpdate(
WorkflowRulesEditorActivityKind Kind,
string Text)
{
public static WorkflowRulesEditorActivityUpdate Status(string text)
{
return new WorkflowRulesEditorActivityUpdate(WorkflowRulesEditorActivityKind.Status, text);
}
public static WorkflowRulesEditorActivityUpdate ToolCall(string toolName)
{
return new WorkflowRulesEditorActivityUpdate(WorkflowRulesEditorActivityKind.ToolCall, toolName);
}
public static WorkflowRulesEditorActivityUpdate Thinking(string text)
{
return new WorkflowRulesEditorActivityUpdate(WorkflowRulesEditorActivityKind.Thinking, text);
}
}
public interface IWorkflowRulesEditorChatPipeline
{
Task<WorkflowRulesEditorChatResult> SendAsync(
IReadOnlyList<WorkflowRulesEditorChatMessage> conversation,
string userMessage,
CancellationToken cancellationToken,
Action<WorkflowRulesEditorActivityUpdate>? activityChanged = null);
}