@sema-agent/core
Version:
Stateless, task-oriented AI agent core
17 lines (16 loc) • 1.19 kB
TypeScript
/**
* The `TaskSpec.images` arms' admission: the same byte admission a file the Read tool serves passes
* (image-admission.ts), with the run's processor — a claimed type the API accepts, within the raw cap, that type's
* signature, then the processor (or, with none, a header-stated size within the reject edge), under the provider's
* base64 limit. Without it a mis-declared image rode straight to the provider and 400'd the whole request. Like the
* Read lane it checks the SIGNATURE, not decodability: a file cut short after its signature passes when no processor
* reads it (KL-1311a-c). The block is built from the bytes that were checked (or the processor made from them).
*/
import type { ImageContent } from "../../internal/llm.js";
import type { ImageInput } from "../types.js";
import type { ImageDownsampler } from "../image-downsample.js";
/** Admit one entry's bytes (`{ data, mimeType }` — inline, or a URL arm's fetched body, `subject` naming which) or throw
* `config.image_invalid`. */
export declare function admitInlineImage(img: Extract<ImageInput, {
data: string;
}>, processor: ImageDownsampler | "none", subject?: string): Promise<ImageContent>;