Unknown Error code 1032 from Apple Intelligence

8 hours ago 3
ARTICLE AD BOX

I'm using Apple intelligence to power suggestions to user of my app. It's a great feature but I'm baffled about this error.

Domain=FoundationModels.LanguageModelSession.GenerationError Code=-1 "(null)" UserInfo={NSMultipleUnderlyingErrorsKey=( "Error Domain=ModelManagerServices.ModelManagerError Code=1032 \"(null)\" UserInfo={NSMultipleUnderlyingErrorsKey=(\n)}" )}

My code uses the "stream" feature and @Generable structures to give the user a great experience.

func generateIdeas(name: String, hero: String, creativity: Creativity, numberOfIdeas: Int) throws -> LanguageModelSession.ResponseStream<[ColorChip]> { try self.checkAvailability() let prompt = """ Please generate at least \(numberOfIdeas) different and unique primary colors for the users idea which they are calling -> \'\(name)\' and pitch -> \'\(hero)\' """ let assistant = colorIdeasModelSession.streamResponse(to: prompt, generating: [ColorChip].self, includeSchemaInPrompt: true, options: creativity.generationOptions) return assistant }

You can see I check the availability and so there is no doubt here is that code:

private func checkAvailability(forModel: SystemLanguageModel = .default) throws { switch forModel.availability { case .available: return case .unavailable(let reason): throw AvailabilityError.unavailable(reason) } }

I also have Apple intelligence turned on and my system language settings matching my Siri language.

enter image description here

Now, when I google this error Google has its AI surface this article from someone with a similar issue. I made sure my languages are correct.

To make the issue more infuriating the error does not actually get thrown until I start listening for the stream in my calling code.

@MainActor func generate() async { self.generatingIdeas = [] focusField = nil do { withAnimation(.snappy) { generationStep = .streaming } let ideaStream = try agent.generateIdeas(name: self.projectName, hero: self.projectPitch, creativity: Creativity.allCases.randomElement() ?? .medium, numberOfIdeas: 5) //Error gets throws from here. for try await partialResponse in ideaStream { self.generatingIdeas = partialResponse.content } withAnimation(.snappy) { generationStep = .finished } generationText = "Generate again" }catch { generationStep = .error(error) } }

What gives? This happens on 2 of my three devices yet I can't find anything on the internet about it? I have filed it in their Feedback Assistant system.

Read Entire Article