Skip to content

Commit

Permalink
fix: add tool_calls to stream result
Browse files Browse the repository at this point in the history
Signed-off-by: rawnly <[email protected]>
  • Loading branch information
rawnly committed Nov 19, 2023
1 parent 25d2a49 commit d393a43
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/OpenAI/Public/Models/Chat/ChatStreamResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

Expand Down

0 comments on commit d393a43

Please sign in to comment.