FunctionResponsePart
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
public struct FunctionResponsePart : PartResult output from a function call.
Contains a string representing the FunctionDeclaration.name and a structured JSON object
containing any output from the function is used as context to the model. This should contain the
result of a FunctionCallPart made based on model prediction.
-
Matching
functionIdfor aFunctionCallPart, if one was provided.Declaration
Swift
public var functionId: String? { get } -
The name of the function that was called.
Declaration
Swift
public var name: String { get } -
The function’s response or return value.
Declaration
Swift
public var response: JSONObject { get } -
Declaration
Swift
public var isThought: Bool { get } -
Constructs a new
FunctionResponse.Declaration
Swift
public init(name: String, response: JSONObject)Parameters
nameThe name of the function that was called.
responseThe function’s response.
-
Constructs a new
FunctionResponse.Declaration
Swift
public init(name: String, response: JSONObject, functionId: String? = nil)Parameters
nameThe name of the function that was called.
responseThe function’s response.
functionIdMatching
functionIdfor aFunctionCallPart, if one was provided.