Public Access
Add meeting assistant speech and summary automation
This commit is contained in:
@@ -58,6 +58,28 @@ public sealed class MarkdownMeetingArtifactStore : IMeetingArtifactStore
|
||||
ToYamlState(state));
|
||||
}
|
||||
|
||||
public async Task UpdateAssistantContextMetadataAsync(
|
||||
MeetingSessionArtifacts artifacts,
|
||||
string agenda,
|
||||
DateTimeOffset? scheduledEnd,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(artifacts.AssistantContextPath)!);
|
||||
var existing = File.Exists(artifacts.AssistantContextPath)
|
||||
? MarkdownDocumentParser.SplitOptional(await File.ReadAllTextAsync(artifacts.AssistantContextPath, cancellationToken))
|
||||
: new MarkdownDocument(false, "", "## Live Context" + Environment.NewLine);
|
||||
var existingFrontmatter = ReadFrontmatter(existing.Frontmatter);
|
||||
var state = ParseState(existingFrontmatter.State);
|
||||
|
||||
await File.WriteAllTextAsync(
|
||||
artifacts.AssistantContextPath,
|
||||
Render(artifacts, state, agenda, scheduledEnd, existing.Body),
|
||||
cancellationToken);
|
||||
logger.LogInformation(
|
||||
"Updated assistant context note {AssistantContextPath} calendar metadata",
|
||||
artifacts.AssistantContextPath);
|
||||
}
|
||||
|
||||
private static string Render(
|
||||
MeetingSessionArtifacts artifacts,
|
||||
AssistantContextState state,
|
||||
@@ -100,6 +122,9 @@ public sealed class MarkdownMeetingArtifactStore : IMeetingArtifactStore
|
||||
|
||||
private sealed class AssistantContextFrontmatterYaml
|
||||
{
|
||||
[YamlMember(Alias = "state")]
|
||||
public string? State { get; set; }
|
||||
|
||||
[YamlMember(Alias = "agenda")]
|
||||
public string? Agenda { get; set; }
|
||||
|
||||
@@ -107,6 +132,19 @@ public sealed class MarkdownMeetingArtifactStore : IMeetingArtifactStore
|
||||
public string? ScheduledEnd { get; set; }
|
||||
}
|
||||
|
||||
private static AssistantContextState ParseState(string? value)
|
||||
{
|
||||
return value?.Trim().ToLowerInvariant() switch
|
||||
{
|
||||
"transcribing" => AssistantContextState.Transcribing,
|
||||
"speaker recognition" => AssistantContextState.SpeakerRecognition,
|
||||
"summarizing" => AssistantContextState.Summarizing,
|
||||
"finished" => AssistantContextState.Finished,
|
||||
"error" => AssistantContextState.Error,
|
||||
_ => AssistantContextState.Transcribing
|
||||
};
|
||||
}
|
||||
|
||||
private static string ToYamlState(AssistantContextState state)
|
||||
{
|
||||
return state switch
|
||||
|
||||
Reference in New Issue
Block a user