FunctionCall
ChatQuery.swift:580struct FunctionCall
struct FunctionCall
s6OpenAI9ChatQueryV0C22CompletionMessageParamO09AssistantfG0V08ToolCallG0V08FunctionJ0V
What are these?9LKA8
import OpenAI
struct ToolCallParam
struct ChatQuery
Creates a model response for the given chat conversation https://platform.openai.com/docs/guides/text-generation
enum ChatCompletionMessageParam
struct AssistantMessageParam
init(from decoder: any Decoder) throws
init(id: String, function: Self.FunctionCall)
let function: Self.FunctionCall
The function that the model called.
let id: String
The ID of the tool call.
let type: Self.ToolsType
The type of the tool. Currently, only function
is supported.
typealias ToolsType = ChatQuery.ChatCompletionToolParam.ToolsType
protocol Decodable
A type that can decode itself from an external representation.
protocol Encodable
A type that can encode itself to an external representation.
protocol Equatable
A type that can be compared for value equality.
init(arguments: String, name: String)
init(from decoder: any Decoder) throws
let arguments: 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.
let name: String
The name of the function to call.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.