Skip to content

Commit

Permalink
Add initializer to ChatFunctionCall to initialize from external with …
Browse files Browse the repository at this point in the history
…properties
  • Loading branch information
yoshiaki-yamada committed Jul 12, 2023
1 parent a51a7fd commit c6533e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/OpenAI/Public/Models/ChatQuery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public struct ChatFunctionCall: Codable, Equatable {
public let name: String?
/// The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
public let arguments: String?

public init(name: String?, arguments: String?) {
self.name = name
self.arguments = arguments
}
}

/// See the [guide](/docs/guides/gpt/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
Expand Down

0 comments on commit c6533e5

Please sign in to comment.