@squidcloud/client
    Preparing search index...

    Type Alias AiAgentResponseFormat

    AiAgentResponseFormat: "text" | "json_object" | AiStructuredOutputFormat

    Response format for AI agent responses.

    Available formats:

    • 'text': Plain text response (default) - standard conversational output
    • 'json_object': JSON response - model attempts to return valid JSON, but without strict schema validation
    • AiStructuredOutputFormat: Structured output with schema (Anthropic only) - guarantees JSON conforms exactly to provided schema

    Structured outputs (Anthropic-specific): For Anthropic models that support structured outputs, you can pass an object with type: 'json_schema' and a JSON schema. This uses constrained decoding to guarantee the response matches your schema perfectly, eliminating parsing errors and validation issues.

    Example with structured output:

    {
    responseFormat: {
    type: 'json_schema',
    schema: {
    type: 'object',
    properties: {
    sentiment: { type: 'string', enum: ['positive', 'negative', 'neutral'] },
    confidence: { type: 'number', minimum: 0, maximum: 1 }
    },
    required: ['sentiment', 'confidence']
    }
    }
    }