| | | 1 | | using Elsa.AI.Abstractions.Models; |
| | | 2 | | |
| | | 3 | | namespace Elsa.AI.Abstractions.Contracts; |
| | | 4 | | |
| | | 5 | | public interface IAIConversationStore |
| | | 6 | | { |
| | | 7 | | ValueTask<AIConversation?> FindAsync(string id, CancellationToken cancellationToken = default); |
| | | 8 | | ValueTask SaveAsync(AIConversation conversation, CancellationToken cancellationToken = default); |
| | | 9 | | } |
| | | 10 | | |
| | | 11 | | public interface IAITransientConversationStore : IAIConversationStore; |
| | | 12 | | |
| | | 13 | | public interface IAIProposalStore |
| | | 14 | | { |
| | | 15 | | ValueTask<AIProposal?> FindAsync(string id, string? tenantId, CancellationToken cancellationToken = default); |
| | | 16 | | ValueTask SaveAsync(AIProposal proposal, CancellationToken cancellationToken = default); |
| | | 17 | | } |
| | | 18 | | |
| | | 19 | | public interface IAIAuditSink |
| | | 20 | | { |
| | | 21 | | ValueTask RecordAsync(AIAuditEvent auditEvent, CancellationToken cancellationToken = default); |
| | | 22 | | |
| | | 23 | | async ValueTask RecordManyAsync(IReadOnlyCollection<AIAuditEvent> auditEvents, CancellationToken cancellationToken = |
| | | 24 | | { |
| | 12 | 25 | | foreach (var auditEvent in auditEvents) |
| | 3 | 26 | | await RecordAsync(auditEvent, cancellationToken); |
| | 3 | 27 | | } |
| | | 28 | | } |