mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-08-11 20:12:12 +00:00
Some provider send additional metadata with their answers. These are often needed for their provider-specific implementation of the chat-completions API. Therefore we do not remove them, but send them with the request
This commit is contained in:
parent
f0e1df12f4
commit
ca90595b8c
@ -1249,6 +1249,7 @@ public abstract class BaseProvider : IProvider, ISecretId
|
||||
{
|
||||
Id = toolCallId,
|
||||
Type = string.IsNullOrWhiteSpace(returnedToolCall?.Type) ? "function" : returnedToolCall.Type,
|
||||
AdditionalMetadata = returnedToolCall?.AdditionalMetadata ?? new Dictionary<string, JsonElement>(),
|
||||
Function = new ChatCompletionToolFunction
|
||||
{
|
||||
Name = string.IsNullOrWhiteSpace(returnedFunctionName) ? "invalid_tool_call" : returnedFunctionName,
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace AIStudio.Provider.OpenAI;
|
||||
|
||||
public sealed record ChatCompletionToolCall
|
||||
@ -7,4 +10,7 @@ public sealed record ChatCompletionToolCall
|
||||
public string? Type { get; init; } = "function";
|
||||
|
||||
public ChatCompletionToolFunction? Function { get; init; }
|
||||
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, JsonElement> AdditionalMetadata { get; init; } = new Dictionary<string, JsonElement>();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user