@@ -109,13 +109,13 @@ public struct FunctionCallPart: Part {
109
109
/// The name of the function to call.
110
110
public var name : String { functionCall. name }
111
111
112
+ /// The function parameters and values.
113
+ public var args : JSONObject { functionCall. args }
114
+
112
115
/// The unique ID of the function call. If specified, this identifier should be included in the
113
116
/// ``FunctionResponsePart``.
114
117
public var id : String ? { functionCall. id }
115
118
116
- /// The function parameters and values.
117
- public var args : JSONObject { functionCall. args }
118
-
119
119
/// Constructs a new function call part.
120
120
///
121
121
/// > Note: A `FunctionCallPart` is typically received from the model, rather than created
@@ -125,7 +125,7 @@ public struct FunctionCallPart: Part {
125
125
/// - name: The name of the function to call.
126
126
/// - args: The function parameters and values.
127
127
public init ( name: String , args: JSONObject ) {
128
- self . init ( FunctionCall ( name: name, id : nil , args : args ) )
128
+ self . init ( FunctionCall ( name: name, args : args , id : nil ) )
129
129
}
130
130
131
131
init ( _ functionCall: FunctionCall ) {
@@ -152,11 +152,11 @@ public struct FunctionResponsePart: Part {
152
152
///
153
153
/// - Parameters:
154
154
/// - name: The name of the function that was called.
155
+ /// - response: The function's response.
155
156
/// - id: The unique ID of the function call, if specified, that this response corresponds with;
156
157
/// see ``FunctionCallPart/id`` for more details.
157
- /// - response: The function's response.
158
- public init ( name: String , id: String ? = nil , response: JSONObject ) {
159
- self . init ( FunctionResponse ( name: name, id: id, response: response) )
158
+ public init ( name: String , response: JSONObject , id: String ? = nil ) {
159
+ self . init ( FunctionResponse ( name: name, response: response, id: id) )
160
160
}
161
161
162
162
init ( _ functionResponse: FunctionResponse ) {
0 commit comments