@@ -147,7 +147,10 @@ public struct FunctionCallPart: Part {
147
147
148
148
public var isThought : Bool { _isThought ?? false }
149
149
150
+ /// Unique id of the function call. If present, the returned ``FunctionResponsePart``
151
+ /// should have a matching `id` field.
150
152
public var id : String ?
153
+
151
154
/// Constructs a new function call part.
152
155
///
153
156
/// > Note: A `FunctionCallPart` is typically received from the model, rather than created
@@ -192,7 +195,7 @@ public struct FunctionResponsePart: Part {
192
195
let _isThought : Bool ?
193
196
let thoughtSignature : String ?
194
197
195
- // TODO: add docs
198
+ /// Matching `id` for a ``FunctionCallPart``, if one was provided.
196
199
public var id : String ? { functionResponse. id }
197
200
198
201
/// The name of the function that was called.
@@ -214,7 +217,12 @@ public struct FunctionResponsePart: Part {
214
217
)
215
218
}
216
219
217
- // TODO: add docs for id param
220
+ /// Constructs a new `FunctionResponse`.
221
+ ///
222
+ /// - Parameters:
223
+ /// - name: The name of the function that was called.
224
+ /// - response: The function's response.
225
+ /// - id: Matching `id` for a ``FunctionCallPart``, if one was provided.
218
226
public init ( name: String , response: JSONObject , id: String ? = nil ) {
219
227
self . init (
220
228
FunctionResponse ( name: name, response: response, id: id) ,
0 commit comments