Skip to content

Commit c45f332

Browse files
authored
Merge pull request #89 from ysak-y/add_initializer_to_chat_function_call
Add initializer to ChatFunctionCall to initialize from external with properties
2 parents ac66006 + c6533e5 commit c45f332

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/OpenAI/Public/Models/ChatQuery.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ public struct ChatFunctionCall: Codable, Equatable {
6161
public let name: String?
6262
/// 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.
6363
public let arguments: String?
64+
65+
public init(name: String?, arguments: String?) {
66+
self.name = name
67+
self.arguments = arguments
68+
}
6469
}
6570

6671
/// 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.

0 commit comments

Comments
 (0)