Skip to content

Commit 579be34

Browse files
Merge pull request #12 from Compiler-Inc/fix/initializer-issues
add public init for function/tool calls
2 parents 65b70a5 + b746d2f commit 579be34

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Sources/CompilerSwiftAI/Model Calling/Domain Models/CompletionRequest.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public extension CompletionRequest {
152152
let type: String
153153
let function: Function
154154

155-
init(function: Function) {
155+
public init(function: Function) {
156156
self.type = "function"
157157
self.function = function
158158
}
@@ -173,6 +173,13 @@ public extension CompletionRequest {
173173
/// Whether to enable strict schema adherence when generating the function call.
174174
let strict: Bool?
175175

176+
public init(name: String, description: String?, parameters: [String : Any]?, strict: Bool?) {
177+
self.name = name
178+
self.description = description
179+
self.parameters = parameters
180+
self.strict = strict
181+
}
182+
176183
func toDTO() -> CompletionRequestDTO.Function {
177184
CompletionRequestDTO.Function(
178185
name: name,

0 commit comments

Comments
 (0)