/opt/canhelp/node_modules/@anthropic-ai/sdk/lib
Edit: /opt/canhelp/node_modules/@anthropic-ai/sdk/lib/parser.d.mts (1591B)
import type { Logger } from "../client.mjs";
import { ContentBlock, JSONOutputFormat, Message, OutputConfig, TextBlock, MessageCreateParams } from "../resources/messages/messages.mjs";
type Simplify
= {
[KeyType in keyof T]: T[KeyType];
} & {};
type AutoParseableOutputConfig = Omit & {
format?: JSONOutputFormat | AutoParseableOutputFormat | null;
};
export type ParseableMessageCreateParams = Simplify & {
output_config?: AutoParseableOutputConfig | null;
}>;
export type ExtractParsedContentFromParams = Params['output_config'] extends {
format: AutoParseableOutputFormat;
} ? P : null;
export type AutoParseableOutputFormat = JSONOutputFormat & {
parse(content: string): ParsedT;
};
export type ParsedMessage = Message & {
content: Array>;
parsed_output: ParsedT | null;
};
export type ParsedContentBlock = (TextBlock & {
parsed_output: ParsedT | null;
}) | Exclude;
export declare function maybeParseMessage(message: Message, params: Params, opts: {
logger: Logger;
}): ParsedMessage>>;
export declare function parseMessage(message: Message, params: Params, opts: {
logger: Logger;
}): ParsedMessage>;
export {};
//# sourceMappingURL=parser.d.mts.map