I'm following along with the WWDC video on SpotlightSearchTool and hitting an error - looking for some guidance.
I've configured SpotlightSearchTool and I'm sending it to the session.
let session = LanguageModelSession(tools: [tool]) {
spotlightSearchInstructions
}
let response = try await session.respond(to: prompt, options: GenerationOptions(toolCallingMode: .required))
I set the tool calling mode to required as a test - without it I don't get errors but the logging makes it seem like it's not calling the search tool and the responses would seem to confirm that (they're not grounded in my data).
So, I figured I'd try forcing it to use the tool. When I do that, I get this console error:
InferenceError::hostFailed::InferenceError::inferenceFailed::TokenGenerationCore.GuidedGenerationError.invalidConfiguration(errorMessage: "Tool Choice requires tools") in response to ExecuteRequest
Error during session.respond. description="The operation couldn’t be completed. (FoundationModels.LanguageModelError error -1.)"
Returning empty Spotlight result. elapsedMs=3254 toolReplies=0 totalSearchItems=0 uniqueSearchItems=0
What does that mean? I'm passing in a tool, everything compiles correctly, etc. Not sure how to debug - any advice appreciated!
Testing this via the Simulator on beta 3.