UNPKG

@autobe/agent

Version:

AI backend server code generator

22 lines (21 loc) 1.01 kB
import { MicroAgentica } from "@agentica/core"; import { IAutoBeVendor } from "../structures/IAutoBeVendor"; /** * Applies function call fallback patches to MicroAgentica agent. * * Some models return function calls as plain text/JSON in `message.content` * instead of the proper `tool_calls` field. This function wraps * `vendor.api.chat.completions.create` to intercept non-streaming responses and * parse text-based function calls into proper `tool_calls`. * * Without this patch, text-based function calls are treated as assistant * messages, causing `enforceFunctionCall` checks to fail. * * The wrapping is idempotent — calling this multiple times with the same vendor * will only wrap once (guarded by a Symbol). * * @param agent MicroAgentica instance (unused, kept for signature consistency * with supportMistral) * @param vendor Vendor configuration containing API instance */ export declare const supportFunctionCallFallback: (_agent: MicroAgentica, vendor: IAutoBeVendor) => void;