Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/apple-llm/ios/AppleLLMImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public class AppleLLMImpl: NSObject {
for (toolName, toolDef) in toolsDict {
guard let description = toolDef["description"] as? String?,
let parameters = toolDef["parameters"] as? [String: Any]? else {
continue
throw AppleLLMError.invalidSchema("Invalid tool definition for \(toolName)")
}

let tool = try JSITool(
Expand Down Expand Up @@ -244,7 +244,7 @@ public class AppleLLMImpl: NSObject {
for message in transcriptMessages {
guard let role = message["role"] as? String,
let content = message["content"] as? String else {
continue
throw AppleLLMError.invalidMessage("Message must have role and content")
}

let segment = Transcript.Segment.text(
Expand Down Expand Up @@ -395,7 +395,7 @@ public class AppleLLMImpl: NSObject {

for (propertyName, propertySchema) in propertiesDict {
guard let propertySchemaDict = propertySchema as? [String: Any] else {
continue
throw AppleLLMError.invalidSchema("Property \(propertyName) schema must be an object")
}

let isOptional = !requiredFields.contains(propertyName)
Expand Down