Public Access
Add attendee transformation workflows
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
using MeetingAssistant.Workflow;
|
||||
|
||||
namespace MeetingAssistant.Tests;
|
||||
|
||||
internal sealed class TransformingAttendeeWorkflowEngine : IMeetingWorkflowEngine
|
||||
{
|
||||
private readonly string source;
|
||||
private readonly string replacement;
|
||||
|
||||
public TransformingAttendeeWorkflowEngine(string source, string replacement)
|
||||
{
|
||||
this.source = source;
|
||||
this.replacement = replacement;
|
||||
}
|
||||
|
||||
public List<string> AttendeeRequests { get; } = [];
|
||||
|
||||
public Task RunAsync(
|
||||
MeetingWorkflowEvent workflowEvent,
|
||||
MeetingAssistantOptions options,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task<string> TransformTranscriptLineAsync(
|
||||
MeetingWorkflowEvent workflowEvent,
|
||||
MeetingAssistantOptions options,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.FromResult(workflowEvent.TranscriptLineText ?? "");
|
||||
}
|
||||
|
||||
public Task<string> TransformAttendeeAsync(
|
||||
MeetingWorkflowEvent workflowEvent,
|
||||
MeetingAssistantOptions options,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
AttendeeRequests.Add(workflowEvent.AttendeeName ?? "");
|
||||
return Task.FromResult(string.Equals(workflowEvent.AttendeeName, source, StringComparison.OrdinalIgnoreCase)
|
||||
? replacement
|
||||
: workflowEvent.AttendeeName ?? "");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user