responseFormat, Polyglot asks the provider for a normal text response. Every provider supports this shape, making it the safest default for any use case.
Basic Usage
A minimal text request requires nothing more than a message:get() method returns the raw string content from the model’s response. There is no JSON parsing, no schema validation — just the text the model produced.
When to Use Text Mode
Plain text is ideal for:- Simple question answering
- Creative content generation (stories, poems, copy)
- Conversational interactions and chat
- Summaries and paraphrasing
- Any use case where structured data is not required
Working Across Providers
Text mode works consistently across all providers, making it the most portable option. You can swap providers without changing anything else about your request:Using the with() Method
You can also use the with() method to pass messages alongside other parameters. Since text is the default, there is no need to specify a response format:
Streaming Text Responses
For long-form content, you may want to stream the response so your application can display output as it arrives:contentDelta with the next chunk of text from the model. Streaming works with all providers that support it.
Accessing the Full Response
If you need metadata beyond the raw text — such as token usage or the finish reason — use theresponse() method instead of get():