@openai/agents-core
Version:
The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows.
52 lines (51 loc) • 1.73 kB
TypeScript
import { Agent } from './agent';
import { RunItem } from './items';
import { ResponseStreamEvent } from './types';
/**
* Streaming event from the LLM. These are `raw` events, i.e. they are directly passed through from
* the LLM.
*/
export declare class RunRawModelStreamEvent {
data: ResponseStreamEvent;
/**
* The type of the event.
*/
readonly type = "raw_model_stream_event";
/**
* @param data The raw responses stream events from the LLM.
*/
constructor(data: ResponseStreamEvent);
}
/**
* The names of the events that can be generated by the agent.
*/
export type RunItemStreamEventName = 'message_output_created' | 'handoff_requested' | 'handoff_occurred' | 'tool_called' | 'tool_output' | 'reasoning_item_created' | 'tool_approval_requested';
/**
* Streaming events that wrap a `RunItem`. As the agent processes the LLM response, it will generate
* these events from new messages, tool calls, tool outputs, handoffs, etc.
*/
export declare class RunItemStreamEvent {
name: RunItemStreamEventName;
item: RunItem;
readonly type = "run_item_stream_event";
/**
* @param name The name of the event.
* @param item The item that was created.
*/
constructor(name: RunItemStreamEventName, item: RunItem);
}
/**
* Event that notifies that there is a new agent running.
*/
export declare class RunAgentUpdatedStreamEvent {
agent: Agent<any, any>;
readonly type = "agent_updated_stream_event";
/**
* @param agent The new agent
*/
constructor(agent: Agent<any, any>);
}
/**
* A streaming event from an agent run.
*/
export type RunStreamEvent = RunRawModelStreamEvent | RunItemStreamEvent | RunAgentUpdatedStreamEvent;