Interface OutputParserStructuredNodeParameters

Source
interface OutputParserStructuredNodeParameters {
    autoFix?: boolean;
    customizeRetryPrompt?: boolean;
    inputSchema?: string;
    jsonSchema?: string;
    jsonSchemaExample?: string;
    prompt?: string;
    schemaType?: "manual" | "fromJson";
}

Properties§

Source§

readonly autoFix?: boolean

Whether to automatically fix the output when it is not in the correct format. Will cause another LLM call.

Source§

readonly customizeRetryPrompt?: boolean

Whether to customize the prompt used for retrying the output parsing. If disabled, a default prompt will be used.

Source§

readonly inputSchema?: string

Schema to use for the function Default: "{\n\t"type": "object",\n\t"properties": {\n\t\t"state": {\n\t\t\t"type": "string"\n\t\t},\n\t\t"cities": {\n\t\t\t"type": "array",\n\t\t\t"items": {\n\t\t\t\t"type": "string"\n\t\t\t}\n\t\t}\n\t}\n}" Type options: {"rows":10}

Source§

readonly jsonSchema?: string

JSON Schema to structure and validate the output against Default: "{\n "type": "object",\n "properties": {\n "state": {\n "type": "string"\n },\n "cities": {\n "type": "array",\n "items": {\n "type": "string"\n }\n }\n }\n}" Type options: {"rows":10}

Source§

readonly jsonSchemaExample?: string

Example JSON object to use to generate the schema Default: "{\n\t"state": "California",\n\t"cities": ["Los Angeles", "San Francisco", "San Diego"]\n}" Type options: {"rows":10}

Source§

readonly prompt?: string

Prompt template used for fixing the output. Uses placeholders: "{instructions}" for parsing rules, "{completion}" for the failed attempt, and "{error}" for the validation error message. Default: "Instructions:\n--------------\n{instructions}\n--------------\nCompletion:\n--------------\n{completion}\n--------------\n\nAbove, the Completion did not satisfy the constraints given in the Instructions.\nError:\n--------------\n{error}\n--------------\n\nPlease try again. Please only respond with an answer that satisfies the constraints laid out in the Instructions:" Type options: {"rows":10}

Source§

readonly schemaType?: "manual" | "fromJson"

How to specify the schema for the function Default: "fromJson"