openai/openai-dotnet

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
OpenAI_2.1.0-beta.1

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/Custom/Chat/Streaming/StreamingChatToolCallUpdate.cs

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