Post

Replies

Boosts

Views

Activity

Reply to "FoundationModels GenerationError error 2" on iOS 26 beta 3
I'm not sure if this will help anyone but I found a bug in the ZIP project located here: https://developer.apple.com/documentation/FoundationModels/adding-intelligent-app-features-with-generative-models As soon as I deleted this line in ItineraryPlanner.swift my error code 2 messages went away and it worked. No clue how this was left in. func suggestItinerary(dayCount: Int) async throws { let stream = session.streamResponse( generating: Itinerary.self, options: GenerationOptions(sampling: .greedy), includeSchemaInPrompt: false ) { "Generate a \(dayCount)-day itinerary to \(landmark.name)." "Give it a fun title and description." "Here is an example, but don't copy it:" Itinerary.exampleTripToJapan } for try await partialResponse in stream { itinerary = partialResponse } } This line: Itinerary.exampleTripToJapan shouldn't be there.
2w