From d393a43ec317b8cd5de40867f8510eda03e0409d Mon Sep 17 00:00:00 2001 From: rawnly Date: Sun, 19 Nov 2023 10:12:17 +0100 Subject: [PATCH] fix: add `tool_calls` to stream result Signed-off-by: rawnly --- Sources/OpenAI/Public/Models/Chat/ChatStreamResult.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/OpenAI/Public/Models/Chat/ChatStreamResult.swift b/Sources/OpenAI/Public/Models/Chat/ChatStreamResult.swift index d1563d23..a058d1a9 100644 --- a/Sources/OpenAI/Public/Models/Chat/ChatStreamResult.swift +++ b/Sources/OpenAI/Public/Models/Chat/ChatStreamResult.swift @@ -15,13 +15,18 @@ public struct ChatStreamResult: Codable, Equatable { public let role: Message.Role? /// The name of the author of this message. `name` is required if role is `function`, and it should be the name of the function whose response is in the `content`. May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters. public let name: String? + + @available(*, deprecated, message: "use toolCalls instead") public let functionCall: ChatFunctionCall? + + public let toolCalls: [ToolCall]? enum CodingKeys: String, CodingKey { case role case content case name case functionCall = "function_call" + case toolCalls = "tool_calls" } }