Skip to content

Commit 924064f

Browse files
eric-humanem1guelpf
authored andcommitted
minor function call fixes
1 parent 902a2a8 commit 924064f

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/Models/Item.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ public enum Item: Identifiable, Equatable, Sendable {
7777
private var type: String = "function_call"
7878
/// The status of the item
7979
public var status: ItemStatus
80-
/// The role associated with the item
81-
public var role: ItemRole
8280
/// The ID of the function call
8381
public var callId: String
8482
/// The name of the function being called
@@ -92,14 +90,16 @@ public enum Item: Identifiable, Equatable, Sendable {
9290
public var id: String
9391
/// The type of the item
9492
private var type: String = "function_call_output"
95-
/// The status of the item
96-
public var status: ItemStatus
97-
/// The role associated with the item
98-
public var role: ItemRole
9993
/// The ID of the function call
10094
public var callId: String
10195
/// The output of the function call
10296
public var output: String
97+
98+
public init(id: String, callId: String, output: String) {
99+
self.id = id
100+
self.callId = callId
101+
self.output = output
102+
}
103103
}
104104

105105
case message(Message)

src/Models/Session.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,13 @@ public struct Session: Codable, Equatable, Sendable {
197197
public var description: String
198198
/// Parameters of the function in JSON Schema.
199199
public var parameters: FunctionParameters
200+
201+
public init(type: String, name: String, description: String, parameters: FunctionParameters) {
202+
self.type = type
203+
self.name = name
204+
self.description = description
205+
self.parameters = parameters
206+
}
200207
}
201208

202209
public enum ToolChoice: Equatable, Sendable {

0 commit comments

Comments
 (0)