new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

react-native-apple/capabilities

10 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

React Native Apple text generation example

Generate text using Apple's on-device language models with this example: import { apple } from '@react-native-ai/apple'; import { generateText } from 'ai'; const { text } = await generateText({ model: apple(), prompt: 'Explain quantum computing in simple terms', });

React Native Apple streaming text generation example

Generate streaming text in real-time with this example: import { apple } from '@react-native-ai/apple'; import { streamText } from 'ai'; const result = streamText({ model: apple(), prompt: 'Write a short story about space exploration', }); for await (const chunk of result.textStream) { console.log(chunk); }

React Native Apple structured output generation example

Generate structured data using Zod schemas with this example: import { apple } from '@react-native-ai/apple'; import { generateText, Output } from 'ai'; import { z } from 'zod'; const result = await generateText({ model: apple(), output: Output.object({ schema: z.object({ recipe: z.string(), ingredients: z.array(z.string()), cookingTime: z.string(), }), }), prompt: 'Create a recipe for chocolate chip cookies', });

React Native Apple tool calling support

The Apple provider supports tool calling where tools are executed by Apple Intelligence rather than the AI SDK. Tools must be pre-registered with the provider using createAppleProvider before they can be used in generation calls.

React Native Apple tool calling example

Use tool calling with Apple Intelligence using this example: import { createAppleProvider } from '@react-native-ai/apple'; import { generateText, tool } from 'ai'; import { z } from 'zod'; const getWeather = tool({ description: 'Get current weather information', inputSchema: z.object({ city: z.string().describe('The city name'), }), execute: async ({ city }) => { return `Weather in ${city}: Sunny, 25°C`; }, }); const apple = createAppleProvider({ availableTools: { getWeather, }, }); const result = await generateText({ model: apple(), prompt: 'What is the weather like in San Francisco?', tools: { getWeather }, });

React Native Apple tool calling limitations

Since tools are executed by Apple Intelligence rather than the AI SDK, multi-step features like stopWhen, onStepStart, and onStepEnd are not supported.

React Native Apple text embeddings example

Apple provides multilingual text embeddings using NLContextualEmbedding, available on iOS 17+. Example: import { apple } from '@react-native-ai/apple'; import { embed } from 'ai'; const { embedding } = await embed({ model: apple.embeddingModel(), value: 'Hello world', });

React Native Apple audio transcription example

Apple provides speech-to-text transcription using SpeechAnalyzer and SpeechTranscriber, available on iOS 26+. Example: import { apple } from '@react-native-ai/apple'; import { transcribe } from 'ai'; const response = await transcribe({ model: apple.transcriptionModel(), audio: audioBuffer, }); console.log(response.text);

React Native Apple basic speech synthesis example

Convert text to speech using this example: import { apple } from '@react-native-ai/apple'; import { generateSpeech } from 'ai'; const response = await generateSpeech({ model: apple.speechModel(), text: 'Hello from Apple on-device speech!', language: 'en-US', });

React Native Apple get available voices

Check for available voices using: import { AppleSpeech } from '@react-native-ai/apple'; const voices = await AppleSpeech.getVoices(); console.log(voices);

Give your agent this brain