Skip to content

Commit 712b8b4

Browse files
committed
Rename id to functionId to avoid identifiable collision
1 parent a574eb4 commit 712b8b4

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

FirebaseAI/Sources/Types/Public/Part.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,10 @@ public struct FunctionCallPart: Part {
147147

148148
public var isThought: Bool { _isThought ?? false }
149149

150-
/// Unique id of the function call. If present, the returned ``FunctionResponsePart``
151-
/// should have a matching `id` field.
152-
public var id: String? { functionCall.id }
150+
/// Unique id of the function call.
151+
///
152+
/// If present, the returned ``FunctionResponsePart`` should have a matching `functionId` field.
153+
public var functionId: String? { functionCall.id }
153154

154155
/// Constructs a new function call part.
155156
///
@@ -196,7 +197,7 @@ public struct FunctionResponsePart: Part {
196197
let thoughtSignature: String?
197198

198199
/// Matching `id` for a ``FunctionCallPart``, if one was provided.
199-
public var id: String? { functionResponse.id }
200+
public var functionId: String? { functionResponse.id }
200201

201202
/// The name of the function that was called.
202203
public var name: String { functionResponse.name }
@@ -222,10 +223,10 @@ public struct FunctionResponsePart: Part {
222223
/// - Parameters:
223224
/// - name: The name of the function that was called.
224225
/// - response: The function's response.
225-
/// - id: Matching `id` for a ``FunctionCallPart``, if one was provided.
226-
public init(name: String, response: JSONObject, id: String? = nil) {
226+
/// - functionId: Matching `functionId` for a ``FunctionCallPart``, if one was provided.
227+
public init(name: String, response: JSONObject, functionId: String? = nil) {
227228
self.init(
228-
FunctionResponse(name: name, response: response, id: id),
229+
FunctionResponse(name: name, response: response, id: functionId),
229230
isThought: nil,
230231
thoughtSignature: nil
231232
)

0 commit comments

Comments
 (0)