IBAIProvider
Identità
Namespace:
B.BAI.BAIProvidersTipo:
interface
Contratto necessario per aggiungere a BAI un provider personalizzato.
Proprietà
string Name { get; }.string DefaultUrl { get; }.bool RequiresApiKey { get; }.
Metodi
string GetRequestUrl(string Url, BAIModel Model, bool Stream).NameValueCollection? GetHeaders(BAIConnectionSettings Settings).string CreateRequestJsonMessage(BAIModel Model, BAIGenerationSettings Settings, List<BAIMessage> Messages, Dictionary<string, object>? StructuredOutput, List<BAIFunction>? Functions, List<BAIFunctionCall>? FuncCalls, bool Stream).bool LoadResponseData(string Json, BAIResponseData Response).bool LoadToolCall(string Json, BAIToolCall ToolCall).bool LoadLogProbability(string Json, BAILogProbability LogProbability).bool LoadModel(string Json, BAIModel Model).BAIStreamChunk? LoadStreamChunk(string Line).string CreateStreamResponseJson(List<string> StreamJson).Task<BAIModel?> GetModelAsync(string Url, BAIConnectionSettings Settings, CancellationToken CancToken).Task<List<BAIModel>> GetModelsAsync(string Url, BAIConnectionSettings Settings, CancellationToken CancToken).Task<List<double>> GetEmbeddingAsync(string Url, BAIConnectionSettings Settings, string ModelName, string Text, CancellationToken CancToken).
Un'implementazione deve normalizzare modelli, risposte, stream e tool call nei DTO di B.BAI.BAIParser; BAIConnection mantiene l'orchestrazione comune.
