import type { Agent } from "./index.js"; import type { AgentStream } from "./stream.js"; import type { InferAgentOutput, ORInputItem, RunOptions, RunResult, SchemaLike } from "./types.js"; /** * A stateful multi-turn conversation with an agent. * * Tracks the full items history across `.send()` calls so the agent * sees prior turns as context. Each send appends the user message and * the assistant's response (including any tool calls) to the history. * * @example * ```typescript * const agent = new Agent({ name: 'assistant', instructions: 'Be helpful.' }); * const conversation = agent.conversation(); * * const r1 = await conversation.send('My name is Alice.'); * const r2 = await conversation.send('What is my name?'); * // r2.output mentions "Alice" — the agent remembers from the prior turn * ``` */ export declare class Conversation { private readonly agent; private readonly items; constructor(agent: Agent); /** * Send a message and run the agent to completion. * * The user message and the full agent response (including tool call * items) are appended to the conversation history. */ send(input: string, options?: RunOptions): Promise>>; /** * Send a message and stream the agent's response. * * Important: the conversation history is only updated after the stream * completes (i.e. after you consume the stream or call `.result()`). */ stream(input: string, options?: RunOptions): AgentStream>; /** Get the current conversation history as items. */ getItems(): readonly ORInputItem[]; /** Clear the conversation history. */ clear(): void; }