toMultipleFormats
toMultipleFormats(
response,formats):Promise<{anthropic?:AnthropicResponse;gemini?:unknown;mistral?:unknown;ollama?:unknown;openai?:OpenAIResponse; }>
Defined in: converters/response-converters.ts:200
Convert Universal IR response to multiple formats at once. Useful for debugging and comparing how different providers handle the same response.
Parameters
Section titled “Parameters”response
Section titled “response”Universal IR response
formats
Section titled “formats”("openai" | "anthropic" | "gemini" | "ollama" | "mistral")[] = ...
Array of format names to convert to
Returns
Section titled “Returns”Promise<{ anthropic?: AnthropicResponse; gemini?: unknown; mistral?: unknown; ollama?: unknown; openai?: OpenAIResponse; }>
Object with converted responses for each format
Example
Section titled “Example”import { toMultipleFormats } from 'ai.matey.utils';
const irResponse = await backend.execute(request);const allFormats = await toMultipleFormats(irResponse, ['openai', 'anthropic', 'gemini']);
console.log('OpenAI:', JSON.stringify(allFormats.openai, null, 2));console.log('Anthropic:', JSON.stringify(allFormats.anthropic, null, 2));console.log('Gemini:', JSON.stringify(allFormats.gemini, null, 2));