@mastra/core
Version:
Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.
34 lines • 1.49 kB
TypeScript
import type { Processor, ProcessInputStepArgs, ProcessInputStepResult } from './index.js';
/**
* Checks whether a model config could be Claude 4.6.
*
* Handles raw model configs (strings like `'anthropic/claude-opus-4-6'`),
* language model objects (with `provider` and `modelId`), dynamic functions
* (returns `true` as a safe default), and model fallback arrays.
*/
export declare function isMaybeClaude46(model: string | {
provider?: string;
modelId?: string;
} | ((...args: any[]) => any) | {
model: any;
enabled?: boolean;
}[] | unknown): boolean;
/**
* Guards against trailing assistant messages when using native structured output
* with Anthropic Claude 4.6.
*
* Claude 4.6 rejects requests where the last message is an assistant message when
* using output format (structured output), interpreting it as pre-filling the response.
* This processor appends a user message to prevent that error.
*
* This processor should only be added when the agent uses a Claude 4.6 model.
* Use {@link isMaybeClaude46} to check before adding.
*
* @see https://github.com/mastra-ai/mastra/issues/12800
*/
export declare class TrailingAssistantGuard implements Processor<'trailing-assistant-guard'> {
readonly id: "trailing-assistant-guard";
readonly name = "Trailing Assistant Guard";
processInputStep({ messages, structuredOutput }: ProcessInputStepArgs): ProcessInputStepResult | undefined;
}
//# sourceMappingURL=trailing-assistant-guard.d.ts.map