Skip to content

RunToolCallItem

  • RunItemBase
new RunToolCallItem(rawItem, agent): RunToolCallItem
Parameter Type

rawItem

| { id: string; name: string; output: string; providerData: Record<string, any>; status: string; type: "hosted_tool_call"; } | { arguments: string; callId: string; id: string; name: string; providerData: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { action: | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; }; callId: string; id: string; providerData: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; }

agent

Agent

RunToolCallItem

RunItemBase.constructor
agent: Agent;

rawItem:
| {
id: string;
name: string;
output: string;
providerData: Record<string, any>;
status: string;
type: "hosted_tool_call";
}
| {
arguments: string;
callId: string;
id: string;
name: string;
providerData: Record<string, any>;
status: "in_progress" | "completed" | "incomplete";
type: "function_call";
}
| {
action: | {
type: "screenshot";
}
| {
button: "left" | "right" | "wheel" | "back" | "forward";
type: "click";
x: number;
y: number;
}
| {
type: "double_click";
x: number;
y: number;
}
| {
scroll_x: number;
scroll_y: number;
type: "scroll";
x: number;
y: number;
}
| {
text: string;
type: "type";
}
| {
type: "wait";
}
| {
type: "move";
x: number;
y: number;
}
| {
keys: string[];
type: "keypress";
}
| {
path: object[];
type: "drag";
};
callId: string;
id: string;
providerData: Record<string, any>;
status: "in_progress" | "completed" | "incomplete";
type: "computer_call";
};

{ id: string; name: string; output: string; providerData: Record<string, any>; status: string; type: "hosted_tool_call"; }

Name Type Description

id?

string

An ID to identify the item. This is optional by default. If a model provider absolutely requires this field, it will be validated on the model level.

name

string

The name of the hosted tool. For example web_search_call or file_search_call

output?

string

The primary output of the tool call. Additional output might be in the providerData field.

providerData?

Record<string, any>

Additional optional provider specific data. Used for custom functionality or model provider specific fields.

status?

string

The status of the tool call.

type

"hosted_tool_call"

{ arguments: string; callId: string; id: string; name: string; providerData: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call"; }

Name Type Description

arguments

string

The arguments of the function call.

callId

string

The ID of the tool call. Required to match up the respective tool call result.

id?

string

An ID to identify the item. This is optional by default. If a model provider absolutely requires this field, it will be validated on the model level.

name

string

The name of the function.

providerData?

Record<string, any>

Additional optional provider specific data. Used for custom functionality or model provider specific fields.

status?

"in_progress" | "completed" | "incomplete"

The status of the function call.

type

"function_call"

{ action: | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; }; callId: string; id: string; providerData: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; }

Name Type Default value Description

action

| { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; }

computerActions

The action to be performed by the computer.

callId

string

The ID of the computer call. Required to match up the respective computer call result.

id?

string

An ID to identify the item. This is optional by default. If a model provider absolutely requires this field, it will be validated on the model level.

providerData?

Record<string, any>

Additional optional provider specific data. Used for custom functionality or model provider specific fields.

status

"in_progress" | "completed" | "incomplete"

The status of the computer call.

type

"computer_call"

RunItemBase.rawItem

readonly type: "tool_call_item";
RunItemBase.type
toJSON(): object

object

agent: object;
name: string;
rawItem:
| undefined
| {
content: (
| {
providerData: Record<string, any>;
refusal: string;
type: "refusal";
}
| {
providerData: Record<string, any>;
text: string;
type: "output_text";
}
| {
providerData: Record<string, any>;
text: string;
type: "input_text";
}
| {
audio: | string
| {
id: string;
};
format: null | string;
providerData: Record<string, any>;
transcript: null | string;
type: "audio";
}
| {
image: string;
providerData: Record<string, any>;
type: "image";
})[];
id: string;
providerData: Record<string, any>;
role: "assistant";
status: "in_progress" | "completed" | "incomplete";
type: "message";
}
| {
content: | string
| (
| {
providerData: Record<string, any>;
text: string;
type: "input_text";
}
| {
image: | string
| {
id: string;
};
providerData: Record<string, any>;
type: "input_image";
}
| {
file: | string
| {
id: string;
};
providerData: Record<string, any>;
type: "input_file";
}
| {
audio: | string
| {
id: string;
};
format: null | string;
providerData: Record<string, any>;
transcript: null | string;
type: "audio";
})[];
id: string;
providerData: Record<string, any>;
role: "user";
type: "message";
}
| {
content: string;
id: string;
providerData: Record<string, any>;
role: "system";
type: "message";
}
| {
id: string;
name: string;
output: string;
providerData: Record<string, any>;
status: string;
type: "hosted_tool_call";
}
| {
arguments: string;
callId: string;
id: string;
name: string;
providerData: Record<string, any>;
status: "in_progress" | "completed" | "incomplete";
type: "function_call";
}
| {
callId: string;
id: string;
name: string;
output: | {
providerData: Record<string, any>;
text: string;
type: "text";
}
| {
data: string;
mediaType: string;
providerData: Record<string, any>;
type: "image";
};
providerData: Record<string, any>;
status: "in_progress" | "completed" | "incomplete";
type: "function_call_result";
}
| {
action: | {
type: "screenshot";
}
| {
button: "left" | "right" | "wheel" | "back" | "forward";
type: "click";
x: number;
y: number;
}
| {
type: "double_click";
x: number;
y: number;
}
| {
scroll_x: number;
scroll_y: number;
type: "scroll";
x: number;
y: number;
}
| {
text: string;
type: "type";
}
| {
type: "wait";
}
| {
type: "move";
x: number;
y: number;
}
| {
keys: string[];
type: "keypress";
}
| {
path: object[];
type: "drag";
};
callId: string;
id: string;
providerData: Record<string, any>;
status: "in_progress" | "completed" | "incomplete";
type: "computer_call";
}
| {
callId: string;
id: string;
output: {
data: string;
providerData: Record<string, any>;
type: "computer_screenshot";
};
providerData: Record<string, any>;
type: "computer_call_result";
}
| {
content: object[];
id: string;
providerData: Record<string, any>;
type: "reasoning";
}
| {
id: string;
providerData: Record<string, any>;
type: "unknown";
};

undefined

{ content: ( | { providerData: Record<string, any>; refusal: string; type: "refusal"; } | { providerData: Record<string, any>; text: string; type: "output_text"; } | { providerData: Record<string, any>; text: string; type: "input_text"; } | { audio: | string | { id: string; }; format: null | string; providerData: Record<string, any>; transcript: null | string; type: "audio"; } | { image: string; providerData: Record<string, any>; type: "image"; })[]; id: string; providerData: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type: "message"; }

{ content: | string | ( | { providerData: Record<string, any>; text: string; type: "input_text"; } | { image: | string | { id: string; }; providerData: Record<string, any>; type: "input_image"; } | { file: | string | { id: string; }; providerData: Record<string, any>; type: "input_file"; } | { audio: | string | { id: string; }; format: null | string; providerData: Record<string, any>; transcript: null | string; type: "audio"; })[]; id: string; providerData: Record<string, any>; role: "user"; type: "message"; }

{ content: string; id: string; providerData: Record<string, any>; role: "system"; type: "message"; }

{ id: string; name: string; output: string; providerData: Record<string, any>; status: string; type: "hosted_tool_call"; }

{ arguments: string; callId: string; id: string; name: string; providerData: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call"; }

{ callId: string; id: string; name: string; output: | { providerData: Record<string, any>; text: string; type: "text"; } | { data: string; mediaType: string; providerData: Record<string, any>; type: "image"; }; providerData: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; }

{ action: | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; }; callId: string; id: string; providerData: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; }

{ callId: string; id: string; output: { data: string; providerData: Record<string, any>; type: "computer_screenshot"; }; providerData: Record<string, any>; type: "computer_call_result"; }

{ content: object[]; id: string; providerData: Record<string, any>; type: "reasoning"; }

{ id: string; providerData: Record<string, any>; type: "unknown"; }

type: string;
RunItemBase.toJSON