import type { AiAdapterContext, AiInvokeInput } from './types';
export declare function readUpstreamError(res: Response): Promise<string>;
export declare function mergeInput(input: AiInvokeInput, defaults?: Record<string, unknown> | null): Record<string, unknown>;
/** input/defaults 原样透传；覆盖 model 与 override（如 stream） */
export declare function toUpstreamJson(ctx: AiAdapterContext, body: Record<string, unknown>, override?: Record<string, unknown>): Record<string, unknown>;
export declare function appendFormFields(form: FormData, body: Record<string, unknown>, skip: Set<string>): void;
export declare function postUpstreamJson(ctx: AiAdapterContext, payload: Record<string, unknown>, headerExtra?: Record<string, string>): Promise<Response>;
export declare function postUpstreamMultipart(ctx: AiAdapterContext, form: FormData, headerExtra?: Record<string, string>): Promise<Response>;
/** 按 contentType 发主请求（json 或 multipart+model） */
export declare function postUpstream(ctx: AiAdapterContext, body: Record<string, unknown>, override?: Record<string, unknown>): Promise<Response>;
