Public Access
Archive summary refinements and profile switching
PR and Push Build/Test / build-and-test (push) Successful in 6m37s
PR and Push Build/Test / build-and-test (push) Successful in 6m37s
This commit is contained in:
@@ -51,7 +51,8 @@ public sealed class OpenAiMeetingSummaryAgentPipeline : IMeetingSummaryPipeline
|
||||
var agentOptions = options.Agent;
|
||||
var key = ResolveApiKey(agentOptions);
|
||||
var writeAudit = new SummaryAgentWriteAudit(artifacts);
|
||||
var tools = CreateTools(new MeetingSummaryTools(artifacts, options, dictationWordStore, writeAudit));
|
||||
var meetingTools = new MeetingSummaryTools(artifacts, options, dictationWordStore, writeAudit);
|
||||
var tools = CreateTools(meetingTools);
|
||||
var instructions = await instructionBuilder.BuildAsync(artifacts, options, cancellationToken);
|
||||
using var compactionSummaryClient = new LiteLlmResponsesChatClient(
|
||||
new Uri(agentOptions.Endpoint),
|
||||
@@ -62,7 +63,8 @@ public sealed class OpenAiMeetingSummaryAgentPipeline : IMeetingSummaryPipeline
|
||||
agentOptions.ReconnectionAttempts,
|
||||
agentOptions.ReconnectionDelay,
|
||||
compactionOptions: null,
|
||||
logger);
|
||||
logger,
|
||||
firstRequestIsUser: false);
|
||||
var compactionOptions = CreateCompactionOptions(agentOptions, compactionSummaryClient);
|
||||
using var chatClient = new LiteLlmResponsesChatClient(
|
||||
new Uri(agentOptions.Endpoint),
|
||||
@@ -73,7 +75,8 @@ public sealed class OpenAiMeetingSummaryAgentPipeline : IMeetingSummaryPipeline
|
||||
agentOptions.ReconnectionAttempts,
|
||||
agentOptions.ReconnectionDelay,
|
||||
compactionOptions,
|
||||
logger);
|
||||
logger,
|
||||
firstRequestIsUser: false);
|
||||
var agent = chatClient
|
||||
.AsBuilder()
|
||||
.UseFunctionInvocation()
|
||||
@@ -93,6 +96,10 @@ public sealed class OpenAiMeetingSummaryAgentPipeline : IMeetingSummaryPipeline
|
||||
session: null,
|
||||
options: new ChatClientAgentRunOptions(CreateChatOptions(agentOptions)),
|
||||
cancellationToken: cancellationToken);
|
||||
if (!meetingTools.SummaryWasWritten)
|
||||
{
|
||||
throw CreateMissingSummaryWriteException(response);
|
||||
}
|
||||
|
||||
await writeAudit.AppendToAssistantContextAsync(cancellationToken);
|
||||
return new MeetingSummaryRunResult(artifacts.SummaryPath, response.Text);
|
||||
@@ -145,6 +152,22 @@ public sealed class OpenAiMeetingSummaryAgentPipeline : IMeetingSummaryPipeline
|
||||
tools.AddDictationWord,
|
||||
"add_dictation_word",
|
||||
"Add one domain term, name, acronym, or unusual word to the transcription dictionary with deduplication."),
|
||||
AIFunctionFactory.Create(
|
||||
tools.AddAttendee,
|
||||
"add_attendee",
|
||||
"Add one attendee to the current meeting note frontmatter when transcript or OCR evidence clearly shows they attended."),
|
||||
AIFunctionFactory.Create(
|
||||
tools.RemoveAttendee,
|
||||
"remove_attendee",
|
||||
"Remove one attendee from the current meeting note frontmatter when evidence clearly shows they did not attend. Do not remove attendees solely because a screenshot contains only partial participant evidence."),
|
||||
AIFunctionFactory.Create(
|
||||
tools.OverrideSpeaker,
|
||||
"override_speaker",
|
||||
"Replace a transcript speaker label with a named speaker only when the evidence is very certain. If the replacement speaker already exists, set merge=true only when both labels are certainly the same identity."),
|
||||
AIFunctionFactory.Create(
|
||||
tools.DeleteIdentity,
|
||||
"delete_identity",
|
||||
"Remove a wrongfully matched speaker identity and relabel transcript mentions to Removed-n only when the evidence is certain."),
|
||||
AIFunctionFactory.Create(
|
||||
tools.WriteSummary,
|
||||
"write_summary",
|
||||
@@ -172,11 +195,21 @@ public sealed class OpenAiMeetingSummaryAgentPipeline : IMeetingSummaryPipeline
|
||||
];
|
||||
}
|
||||
|
||||
private static InvalidOperationException CreateMissingSummaryWriteException(AgentResponse response)
|
||||
{
|
||||
var message = string.IsNullOrWhiteSpace(response.Text)
|
||||
? "Summary agent completed without calling write_summary."
|
||||
: $"Summary agent completed without calling write_summary. Response: {response.Text}";
|
||||
|
||||
return new InvalidOperationException(message);
|
||||
}
|
||||
|
||||
private static ChatOptions CreateChatOptions(AgentOptions options)
|
||||
{
|
||||
var chatOptions = new ChatOptions
|
||||
{
|
||||
ModelId = options.Model,
|
||||
MaxOutputTokens = options.MaxOutputTokens,
|
||||
AllowMultipleToolCalls = true,
|
||||
ToolMode = ChatToolMode.Auto
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user