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 · modeblame

9f9f2936Jose Arriaga Maldonado2 years ago1namespace OpenAI.Chat;
2
3using System;
4
31c2ba63Jose Arriaga Maldonado1 years ago5/// <summary> A streaming update representing part of a tool call made by the model. </summary>
9f9f2936Jose Arriaga Maldonado2 years ago6[CodeGenModel("ChatCompletionMessageToolCallChunk")]
7[CodeGenSuppress("StreamingChatToolCallUpdate", typeof(int))]
8public partial class StreamingChatToolCallUpdate
9{
31c2ba63Jose Arriaga Maldonado1 years ago10// CUSTOM: Made internal.
9f9f2936Jose Arriaga Maldonado2 years ago11[CodeGenMember("Function")]
12internal 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")]
19public ChatToolCallKind Kind { get; } = ChatToolCallKind.Function;
20
31c2ba63Jose Arriaga Maldonado1 years ago21// CUSTOM: Renamed.
9f9f2936Jose Arriaga Maldonado2 years ago22/// <summary>
31c2ba63Jose Arriaga Maldonado1 years ago23/// 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)"/>.
9f9f2936Jose Arriaga Maldonado2 years ago26/// </summary>
31c2ba63Jose Arriaga Maldonado1 years ago27[CodeGenMember("Id")]
28public string ToolCallId { get; }
9f9f2936Jose Arriaga Maldonado2 years ago29
30/// <summary>
31c2ba63Jose Arriaga Maldonado1 years ago31/// The name of the the tool that the streaming tool call requests invocation of.
32/// </summary>
33public 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.
9f9f2936Jose Arriaga Maldonado2 years ago42/// </summary>
31c2ba63Jose Arriaga Maldonado1 years ago43public BinaryData FunctionArgumentsUpdate => Function?.Arguments;
9f9f2936Jose Arriaga Maldonado2 years ago44}