import { z } from 'zod'; import { Tool, type ToolContext, type ToolStreamGenerator } from './tool.js'; import type { ToolSpec } from './types.js'; /** Tool name used for structured output validation. */ export declare const STRUCTURED_OUTPUT_TOOL_NAME = "strands_structured_output"; /** * Tool that validates LLM output against a Zod schema. * Provides validation feedback to the LLM for retry on failures. */ export declare class StructuredOutputTool extends Tool { private _schema; private _toolSpec; /** * Creates a new StructuredOutputTool. * * @param schema - The Zod schema to validate against */ constructor(schema: z.ZodSchema); /** @returns The tool name. */ get name(): string; /** @returns The tool description. */ get description(): string; /** @returns The full tool specification. */ get toolSpec(): ToolSpec; /** * Validates input against the schema. * On success, returns a ToolResultBlock with the validated JSON. * On failure, returns formatted validation errors for LLM retry. * * @param toolContext - The tool execution context * @returns Generator that returns a ToolResultBlock */ stream(toolContext: ToolContext): ToolStreamGenerator; /** * Builds the tool specification from the schema. * * @returns Tool specification with name, description, and input schema */ private _buildSpec; } //# sourceMappingURL=structured-output-tool.d.ts.map