Generation Error

So I'm having an issue with the FoundationModels framework but idk if this is just my feeling or not, the issue comes up after I updated my Mac into 26.6

the code was very simple actually: #Playground { let model = SystemLanguageModel.default let session = LanguageModelSession(model: model) print(model.availability)

var query = "How to hide button"

Task {
    do {
        let response = try await session.respond(to: query)
        print(response.content)
    } catch {
        print("\(error)")
    }
}

}

the code works before I updated the version, but then after I updated the version it says: Error Domain=FoundationModels.LanguageModelSession.GenerationError Code=-1 "The operation couldn’t be completed. (FoundationModels.LanguageModelError error -1.)" UserInfo={NSMultipleUnderlyingErrorsKey=( "Error Domain=FoundationModels.LanguageModelError Code=-1 "(null)" UserInfo={NSMultipleUnderlyingErrorsKey=(\n "Error Domain=ModelManagerServices.ModelManagerError Code=1026 \"(null)\" UserInfo={NSMultipleUnderlyingErrorsKey=(\n)}"\n)}" ), NSLocalizedDescription=The operation couldn’t be completed. (FoundationModels.LanguageModelError error -1.)}

this is runned in Xcode 26.6, additional information I have also coder 27 beta 4 installed in my Mac, is this problem occurring because the Xcode 26.6 and Xcode 27 beta 4?? can u guys help me

What is the device you're running this code on, and what is the deployment target? If you're targeting the simulator for iOS 27 beta, then you need to make sure that your Mac is also updated to macOS 27 beta, since the simulator uses the host Mac for inference.

1st thing to check, just like @Frameworks Engineer suggested:

Ensure Xcode version = macOS version = deployment target device version exactly

2nd thing to check, a new issue we're seeing in 27 betas:

  1. Go to Settings > Siri
  2. At the top, just check that there isn't any kind of unavailability message. A common one we're seeing is language mis-match between Siri language and device language. If there's any issue making Siri unavailable, we're seeing in this beta it can cause errors similar to what you're seeing. The workaround is to address any warning the Siri setting is telling you, even if you have Siri turned off.
Generation Error
 
 
Q