UNPKG

@mastra/core

Version:
24 lines • 1.62 kB
import type { Processor, ProcessAPIErrorArgs, ProcessAPIErrorResult, ProcessLLMRequestArgs, ProcessLLMRequestResult } from './index.js'; /** * Lets an agent keep working when the model rejects a file the user sent. * * The file goes to the model unchanged first: which types a model reads varies * by provider and changes over time, so nothing is guessed up front. When the * provider SDK refuses a file type before sending the request, or the provider * rejects a request that holds a file the model may not read, this processor * replaces the rejected file, and every other file that isn't an image, a PDF, * or text, then calls the model once more. When the agent's workspace has a * sandbox, each file is uploaded there and the model gets its path; otherwise, * or when the upload fails, it gets a note saying the file wasn't sent. Only the * prompt changes: the stored messages keep their files, and a thread that * already stores such a file works again on its next turn. * * Part of the default error processors of every agent; `errorProcessorDefaults: false` turns it off. */ export declare class UnsupportedFileHandler implements Processor<'unsupported-file-handler'> { readonly id: 'unsupported-file-handler'; readonly name = "Unsupported File Handler"; processAPIError({ error, messageList, retryCount, state, }: ProcessAPIErrorArgs): Promise<ProcessAPIErrorResult | void>; processLLMRequest({ prompt, messageList, workspace, requestContext, abortSignal, state, }: ProcessLLMRequestArgs): Promise<ProcessLLMRequestResult>; } //# sourceMappingURL=unsupported-file-handler.d.ts.map