Skip to content

Commit

Permalink
Merge pull request #89 from ysak-y/add_initializer_to_chat_function_call
Browse files Browse the repository at this point in the history
Add initializer to ChatFunctionCall to initialize from external with properties
  • Loading branch information
Krivoblotsky authored Aug 22, 2023
2 parents ac66006 + c6533e5 commit c45f332
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 c45f332

Please sign in to comment.