/** * Per-call options of `Agent.chat` (Python parity: `agent/chat_mixin.py` * `chat()` / `_chat_impl()`). * * Four behaviours live here, each a direct port of what Python does with the * keyword argument of the same name: * * - `attachments`: images for THIS turn only. Python's * `_build_multimodal_prompt` turns the text prompt plus a list of paths, * URLs or data URIs into an OpenAI multimodal `content` array. The text * still goes into history on its own; the attachment never does. * - `reasoningSteps`: Python forces a single NON-streaming completion for the * turn (`llm/llm.py`: "If reasoning_steps is True, do a single * non-streaming call"), because a reasoning response is only readable whole. * - `taskName` / `taskDescription` / `taskId`: metadata that Python threads * through the whole turn into `display_interaction` and the interaction * callbacks. Here the equivalent observer channel is the hooks manager, so * the three travel on the `agent_start` / `agent_complete` hook contexts and * are readable afterwards via `Agent.getTaskContext()`. * - `config`: Python only forwards it, unchanged, to a managed backend's * `execute()` (`execution_mixin.py::_delegate_to_backend`). So does this. */ /** A text part of a multimodal prompt (OpenAI `content` array). */ export interface PromptTextPart { type: 'text'; text: string; } /** An image part of a multimodal prompt (OpenAI `content` array). */ export interface PromptImagePart { type: 'image_url'; image_url: { url: string; }; } export type PromptPart = PromptTextPart | PromptImagePart; /** * Task metadata for one turn (Python's `task_name` / `task_description` / * `task_id` triple). `undefined` when the caller named none of the three. */ export interface TaskContext { name?: string; description?: string; id?: string; } /** Build the {@link TaskContext} for a turn, or `undefined` when unused. */ export declare function resolveTaskContext(opts: { taskName?: string; taskDescription?: string; taskId?: string; }): TaskContext | undefined; /** * Merge a {@link TaskContext} into a hook/observer payload. Absent fields are * not written, so a hook can tell "no task metadata" from "an empty name". */ export declare function withTaskContext>(payload: T, task: TaskContext | undefined): T; /** * Python `_build_multimodal_prompt`: a string when there is nothing to * attach, otherwise the OpenAI multimodal `content` array with the text first. * * A local image file is read and inlined as a base64 data URI; an * `http(s)://` or `data:` attachment is passed through as a URL. Anything * else (a missing file, a non-image extension, an unreadable file) is * reported through `onWarning` and skipped -- exactly Python's behaviour, * which logs and continues rather than failing the turn. * * `readFile` is injectable so a test need not touch the filesystem. */ export declare function buildMultimodalPrompt(prompt: string, attachments: readonly string[] | undefined, options?: { onWarning?: (message: string) => void; readFile?: (file: string) => Buffer | null | Promise; }): Promise;