Interface ISupportAiConnectionService
- Namespace
- Tharga.Team
- Assembly
- Tharga.Team.dll
What the support assistant answers a team with — the platform's model, the team's own provider, or nothing — chosen by the team.
public interface ISupportAiConnectionService
Remarks
Operations, not a settings record. Using the platform's model, turning the assistant off and connecting a provider are separate operations, because each is authorized, checked and audited as the fact it is. Connecting a provider in particular is refused unless the provider answers first, which a generic save could not express.
Every operation requires the assistant:manage scope on the team. Whether a member is offered the assistant
is a different question, answered by GetAssistantReadinessAsync(string, CancellationToken) to members.
The key goes in and never comes out. It is stored encrypted, and no operation, result, log entry or audit entry carries it.
Methods
ConnectAsync(string, SupportAiProviderRequest, CancellationToken)
Answers the team with a provider, after checking that the provider lists the chosen model for the key. Nothing is saved unless that check passes.
Task<SupportAiConnectionResult> ConnectAsync(string teamKey, SupportAiProviderRequest request, CancellationToken cancellationToken = default)
Parameters
teamKeystringrequestSupportAiProviderRequestcancellationTokenCancellationToken
Returns
GetChoicesAsync(string, CancellationToken)
What the team may choose here: the platform's model only when the host has one, and the providers the host installed.
Task<SupportAiConnectionChoices> GetChoicesAsync(string teamKey, CancellationToken cancellationToken = default)
Parameters
teamKeystringcancellationTokenCancellationToken
Returns
GetConnectionAsync(string, CancellationToken)
The team's connection; the platform's model when the team never chose.
Task<SupportAiConnection> GetConnectionAsync(string teamKey, CancellationToken cancellationToken = default)
Parameters
teamKeystringcancellationTokenCancellationToken
Returns
ListModelsAsync(string, SupportAiProviderRequest, CancellationToken)
The models a provider offers for the key, so one can be chosen. Saves nothing.
Task<SupportAiModelList> ListModelsAsync(string teamKey, SupportAiProviderRequest request, CancellationToken cancellationToken = default)
Parameters
teamKeystringrequestSupportAiProviderRequestcancellationTokenCancellationToken
Returns
TestAsync(string, SupportAiProviderRequest, CancellationToken)
Sends the model one short message and returns its reply, to show that answering works. Saves nothing.
Task<SupportAiConnectionResult> TestAsync(string teamKey, SupportAiProviderRequest request, CancellationToken cancellationToken = default)
Parameters
teamKeystringrequestSupportAiProviderRequestcancellationTokenCancellationToken
Returns
TurnOffAsync(string, CancellationToken)
Turns the assistant off for the team, and forgets any key the team stored.
Task TurnOffAsync(string teamKey, CancellationToken cancellationToken = default)
Parameters
teamKeystringcancellationTokenCancellationToken
Returns
UsePlatformModelAsync(string, CancellationToken)
Answers the team with the platform's model, and forgets any key the team stored.
Task UsePlatformModelAsync(string teamKey, CancellationToken cancellationToken = default)
Parameters
teamKeystringcancellationTokenCancellationToken