openai/openai-dotnet

Public

mirrored from https://github.com/openai/openai-dotnetAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
OpenAI_2.2.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/Custom/Chat/Streaming/StreamingChatToolCallUpdate.cs

42lines · modecode

1namespace OpenAI.Chat;
2
3using System;
4
5/// <summary> A streaming update representing part of a tool call made by the model. </summary>
6[CodeGenType("ChatCompletionMessageToolCallChunk")]
7[CodeGenSuppress("StreamingChatToolCallUpdate", typeof(int))]
8public partial class StreamingChatToolCallUpdate
9{
10 // CUSTOM: Made internal.
11 [CodeGenMember("Function")]
12 internal InternalChatCompletionMessageToolCallChunkFunction Function { get; }
13 // CUSTOM:
14 // - Changed type to match public type.
15 /// <summary> The kind of tool.Currently, only<see cref="ChatToolCallKind.Function"/> is supported. </summary>
16 [CodeGenMember("Type")]
17 public ChatToolCallKind Kind { get; } = ChatToolCallKind.Function;
18
19 // CUSTOM: Renamed.
20 /// <summary>
21 /// The unique identifier of the tool call being streamed, as used with e.g.
22 /// <see cref="ChatToolCall.CreateFunctionToolCall(string, string, BinaryData)"/> or
23 /// <see cref="ToolChatMessage.ToolChatMessage(string, string)"/>.
24 /// </summary>
25 [CodeGenMember("Id")]
26 public string ToolCallId { get; }
27
28 /// <summary>
29 /// The name of the the tool that the streaming tool call requests invocation of.
30 /// </summary>
31 public string FunctionName => Function?.Name;
32
33 // CUSTOM: Spread.
34 /// <summary>
35 /// The update to the arguments that the model is calling the function with, which are generated by the model
36 /// in JSON format. As part of a streaming response, the arguments are chunked and streamed across streaming
37 /// updates, and must therefore be accumulated in order to reconstruct them. Note that the model does not
38 /// always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate
39 /// the arguments in your code before calling your function.
40 /// </summary>
41 public BinaryData FunctionArgumentsUpdate => Function?.Arguments;
42}
43