import { TurnContext } from 'botbuilder'; import { Schema } from 'jsonschema'; import { Memory } from '../MemoryFork'; import { Validation, PromptResponseValidator } from './PromptResponseValidator'; import { Tokenizer } from '../tokenizers'; import { PromptResponse } from '../types'; /** * Parses any JSON returned by the model and optionally verifies it against a JSON schema. * @template TValue Optional. Type of the validation value returned. Defaults to `Record`. */ export declare class JSONResponseValidator> implements PromptResponseValidator { /** * Creates a new `JSONResponseValidator` instance. * @param {Schema} schema Optional. JSON schema to validate the response against. * @param {string} missingJsonFeedback Optional. Custom feedback to give when no JSON is returned. * @param {string} errorFeedback Optional. Custom feedback prefix to use when schema errors are detected. */ constructor(schema?: Schema, missingJsonFeedback?: string, errorFeedback?: string); /** * Feedback prefix given when schema errors are detected. */ errorFeedback: string; /** * Feedback given when no JSON is returned. */ missingJsonFeedback: string; /** * JSON schema to validate the response against. */ readonly schema?: Schema; /** * Validates a response to a prompt. * @param {TurnContext} context Context for the current turn of conversation with the user. * @param {Memory} memory An interface for accessing state values. * @param {Tokenizer} tokenizer Tokenizer to use for encoding and decoding text. * @param {PromptResponse} response Response to validate. * @param {number} remaining_attempts Number of remaining attempts to validate the response. * @returns {Promise>} A `Validation` object. */ validateResponse(context: TurnContext, memory: Memory, tokenizer: Tokenizer, response: PromptResponse, remaining_attempts: number): Promise>; /** * @private * @param {ValidationError} error Error in the JSON object * @returns {string} How to fix the given error. */ private getErrorFix; } //# sourceMappingURL=JSONResponseValidator.d.ts.map