Use output parsing when the rest of your application needs a typed value instead of free-form text. Add bounded retries for transient model failures, while leaving validation and policy failures visible to your application.
Parse a typed output
parseOutput converts the final text after the agent loop completes:
For stricter model behaviour, combine parsing with a structured response from the gateway client:
Retry model requests
Use modelRetry when a transient model failure should be retried inside the current run:
maxRetries counts attempts after the first request. The final attempt count is stored on the step as modelAttempts.
Use managed routing defaults
Use preset when routing, prompt, or parameter defaults should remain in the dashboard:
The gateway adapter can also carry responseFormat, plugins, gatewayTools, toolChoice, webSearchOptions, providerOptions, promptCacheKey, and includeMeta.
Last modified on July 26, 2026