IAiChatService
Provides persisted, access-controlled AI conversations for the portal, Telegram, and external clients.
Implementiert: IBaseEntityService<AiChat>
Methoden
public Task<AiConversation> CancelAsync(long conversationId, Guid requestId, CancellationToken cancellationToken)
result = iAiChatService.CancelAsync(conversationId, requestId, cancellationToken)
Requests cancellation of an active generation owned by the current client.
public Task<AiChatSendResult> EditAndRetryAsync(long userMessageId, string text, Guid requestId, CancellationToken cancellationToken)
result = iAiChatService.EditAndRetryAsync(userMessageId, text, requestId, cancellationToken)
Creates an edited branch without mutating the original user message or ledger.
public Task<BaseEntitySet<AiChat>> FindAsync(long skip, long? count, bool? deleted, string orderBy, bool? orderByDesc, bool? totalCount, DateTime? creationStart, DateTime? creationEnd, long? clientId, bool? allClients, AiGenerationChannels? channel, string externalId, string like, ComparisonOperator? likeCompare, CancellationToken cancellationToken)
result = iAiChatService.FindAsync(skip, count, deleted, orderBy, orderByDesc, totalCount, creationStart, creationEnd, clientId, allClients, channel, externalId, like, likeCompare, cancellationToken)
Gets conversations visible to the current client.
public Task<BaseEntitySet<AiConversation>> FindMessagesAsync(long conversationId, long skip, long? count, CancellationToken cancellationToken)
result = iAiChatService.FindMessagesAsync(conversationId, skip, count, cancellationToken)
Gets the turns of one authorized conversation, each the generation that produced it.
public Task<AiChat> GetOrCreateAsync(long ownerClientId, string name, AiGenerationChannels channel, string externalId, AiChatModes mode, AIAgentTypes agentType, CancellationToken cancellationToken)
result = iAiChatService.GetOrCreateAsync(ownerClientId, name, channel, externalId, mode, agentType, cancellationToken)
Creates or returns an idempotent conversation with a server-owned policy.
- ownerClientId
- The paying owner for a trusted channel, or zero for the current client.
- name
- The initial user-visible name.
- channel
- The channel.
- externalId
- The trusted channel conversation identifier; empty asks for a new one.
- mode
- The server-owned workflow the conversation runs in.
- agentType
- The AI provider family the conversation uses.
- cancellationToken
- The cancellation token.
Rückgabe: The conversation.
public Task<AiChat> RenameAsync(long conversationId, string name, CancellationToken cancellationToken)
result = iAiChatService.RenameAsync(conversationId, name, cancellationToken)
Renames an authorized conversation.
public Task<AiChatSendResult> RetryAsync(long assistantMessageId, Guid requestId, CancellationToken cancellationToken)
result = iAiChatService.RetryAsync(assistantMessageId, requestId, cancellationToken)
Branches from an earlier user message and starts a newly billed generation.
public Task<AiChatSendResult> SendAsync(AiChatSendRequest request, CancellationToken cancellationToken)
result = iAiChatService.SendAsync(request, cancellationToken)
Stores a user message and starts at most one generation, provided the balance holds at least a cent; the generation is charged once it has produced its result.