跳转到内容

RunToolSearchOutputItem

此内容尚不支持你的语言。

  • RunItemBase
new RunToolSearchOutputItem(rawItem, agent): RunToolSearchOutputItem;
Parameter Type Description

rawItem

{ call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; type: "tool_search_output"; }

rawItem.call_id?

string | null

rawItem.callId?

string | null

rawItem.execution?

"client" | "server"

rawItem.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.

rawItem.providerData?

Record<string, any>

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

rawItem.status?

string

rawItem.tools

Record<string, any>[]

rawItem.type

"tool_search_output"

agent

Agent

RunToolSearchOutputItem

RunItemBase.constructor
agent: Agent;

rawItem: object;
Name Type Description

call_id?

string | null

callId?

string | null

execution?

"client" | "server"

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?

string

tools

Record<string, any>[]

type

"tool_search_output"

RunItemBase.rawItem

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

object

agent: object;
name: string;
rawItem:
| {
content: (
| {
providerData?: Record<string, any>;
refusal: string;
type: "refusal";
}
| {
providerData?: Record<string, any>;
text: string;
type: "output_text";
}
| {
audio: | string
| {
id: string;
};
format?: string | null;
providerData?: Record<string, any>;
transcript?: string | null;
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";
}
| {
detail?: string;
image?: | string
| {
id: string;
};
providerData?: Record<string, any>;
type: "input_image";
}
| {
file?: | string
| {
id: string;
}
| {
url: string;
};
filename?: string;
providerData?: Record<string, any>;
type: "input_file";
}
| {
audio: | string
| {
id: string;
};
format?: string | null;
providerData?: Record<string, any>;
transcript?: string | null;
type: "audio";
})[];
id?: string;
providerData?: Record<string, any>;
role: "user";
type?: "message";
}
| {
content: string;
id?: string;
providerData?: Record<string, any>;
role: "system";
type?: "message";
}
| {
arguments?: string;
id?: string;
name: string;
output?: string;
providerData?: Record<string, any>;
status?: string;
type: "hosted_tool_call";
}
| {
arguments: string;
callId: string;
id?: string;
name: string;
namespace?: string;
providerData?: Record<string, any>;
status?: "in_progress" | "completed" | "incomplete";
type: "function_call";
}
| {
arguments: unknown;
call_id?: string | null;
callId?: string | null;
execution?: "client" | "server";
id?: string;
providerData?: Record<string, any>;
status?: string;
type: "tool_search_call";
}
| {
call_id?: string | null;
callId?: string | null;
execution?: "client" | "server";
id?: string;
providerData?: Record<string, any>;
status?: string;
tools: Record<string, any>[];
type: "tool_search_output";
}
| {
callId: string;
id?: string;
name: string;
namespace?: string;
output: | string
| {
providerData?: Record<string, any>;
text: string;
type: "text";
}
| {
detail?: "low" | "high" | "auto" | string & object;
image?: | string
| {
data: string | Uint8Array<ArrayBuffer>;
mediaType?: string;
}
| {
url: string;
}
| {
fileId: string;
};
providerData?: Record<string, any>;
type: "image";
}
| {
file: | string
| {
data: string | Uint8Array<ArrayBuffer>;
filename: string;
mediaType: string;
}
| {
filename?: string;
url: string;
}
| {
filename?: string;
id: string;
};
providerData?: Record<string, any>;
type: "file";
}
| (
| {
providerData?: Record<string, any>;
text: string;
type: "input_text";
}
| {
detail?: string;
image?: | string
| {
id: string;
};
providerData?: Record<string, any>;
type: "input_image";
}
| {
file?: | string
| {
id: string;
}
| {
url: string;
};
filename?: string;
providerData?: Record<string, any>;
type: "input_file";
})[];
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";
};
actions?: (
| {
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";
}
| {
action: {
commands: string[];
maxOutputLength?: number;
timeoutMs?: number;
};
callId: string;
id?: string;
providerData?: Record<string, any>;
status?: "in_progress" | "completed" | "incomplete";
type: "shell_call";
}
| {
callId: string;
id?: string;
maxOutputLength?: number;
output: object[];
providerData?: Record<string, any>;
type: "shell_call_output";
}
| {
callId: string;
id?: string;
operation: | {
diff: string;
path: string;
type: "create_file";
}
| {
diff: string;
moveTo?: string;
path: string;
type: "update_file";
}
| {
path: string;
type: "delete_file";
};
providerData?: Record<string, any>;
status: "in_progress" | "completed";
type: "apply_patch_call";
}
| {
callId: string;
id?: string;
output?: string;
providerData?: Record<string, any>;
status: "completed" | "failed";
type: "apply_patch_call_output";
}
| {
content: object[];
id?: string;
providerData?: Record<string, any>;
rawContent?: object[];
type: "reasoning";
}
| {
created_by?: string;
encrypted_content: string;
id?: string;
providerData?: Record<string, any>;
type: "compaction";
}
| {
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";
}
| {
audio: | string
| {
id: string;
};
format?: string | null;
providerData?: Record<string, any>;
transcript?: string | null;
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";
}
Name Type Description

content

( | { providerData?: Record<string, any>; refusal: string; type: "refusal"; } | { providerData?: Record<string, any>; text: string; type: "output_text"; } | { audio: | string | { id: string; }; format?: string | null; providerData?: Record<string, any>; transcript?: string | null; type: "audio"; } | { image: string; providerData?: Record<string, any>; type: "image"; })[]

The content of the message.

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.

role

"assistant"

Representing a message from the assistant (i.e. the model)

status

"in_progress" | "completed" | "incomplete"

The status of the message.

type?

"message"

Any item without a type is treated as a message


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

content

| string | ( | { providerData?: Record<string, any>; text: string; type: "input_text"; } | { detail?: string; image?: | string | { id: string; }; providerData?: Record<string, any>; type: "input_image"; } | { file?: | string | { id: string; } | { url: string; }; filename?: string; providerData?: Record<string, any>; type: "input_file"; } | { audio: | string | { id: string; }; format?: string | null; providerData?: Record<string, any>; transcript?: string | null; type: "audio"; })[]

The content of the message.

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.

role

"user"

Representing a message from the user

type?

"message"

Any item without a type is treated as a message


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

content

string

The content of the message.

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.

role

"system"

Representing a system message to the user

type?

"message"

Any item without a type is treated as a message


{
arguments?: string;
id?: string;
name: string;
output?: string;
providerData?: Record<string, any>;
status?: string;
type: "hosted_tool_call";
}
Name Type Description

arguments?

string

The arguments of the hosted tool call.

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;
namespace?: 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.

namespace?

string

Optional namespace used to qualify the function name for tool search.

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"


{
arguments: unknown;
call_id?: string | null;
callId?: string | null;
execution?: "client" | "server";
id?: string;
providerData?: Record<string, any>;
status?: string;
type: "tool_search_call";
}
Name Type Default value Description

arguments

unknown

ToolSearchCallArguments

call_id?

string | null

callId?

string | null

execution?

"client" | "server"

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?

string

type

"tool_search_call"


{
call_id?: string | null;
callId?: string | null;
execution?: "client" | "server";
id?: string;
providerData?: Record<string, any>;
status?: string;
tools: Record<string, any>[];
type: "tool_search_output";
}
Name Type Description

call_id?

string | null

callId?

string | null

execution?

"client" | "server"

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?

string

tools

Record<string, any>[]

type

"tool_search_output"


{
callId: string;
id?: string;
name: string;
namespace?: string;
output: | string
| {
providerData?: Record<string, any>;
text: string;
type: "text";
}
| {
detail?: "low" | "high" | "auto" | string & object;
image?: | string
| {
data: string | Uint8Array<ArrayBuffer>;
mediaType?: string;
}
| {
url: string;
}
| {
fileId: string;
};
providerData?: Record<string, any>;
type: "image";
}
| {
file: | string
| {
data: string | Uint8Array<ArrayBuffer>;
filename: string;
mediaType: string;
}
| {
filename?: string;
url: string;
}
| {
filename?: string;
id: string;
};
providerData?: Record<string, any>;
type: "file";
}
| (
| {
providerData?: Record<string, any>;
text: string;
type: "input_text";
}
| {
detail?: string;
image?: | string
| {
id: string;
};
providerData?: Record<string, any>;
type: "input_image";
}
| {
file?: | string
| {
id: string;
}
| {
url: string;
};
filename?: string;
providerData?: Record<string, any>;
type: "input_file";
})[];
providerData?: Record<string, any>;
status: "in_progress" | "completed" | "incomplete";
type: "function_call_result";
}
Name Type Description

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 tool that was called

namespace?

string

Optional namespace preserved from the originating function call.

output

| string | { providerData?: Record<string, any>; text: string; type: "text"; } | { detail?: "low" | "high" | "auto" | string & object; image?: | string | { data: string | Uint8Array<ArrayBuffer>; mediaType?: string; } | { url: string; } | { fileId: string; }; providerData?: Record<string, any>; type: "image"; } | { file: | string | { data: string | Uint8Array<ArrayBuffer>; filename: string; mediaType: string; } | { filename?: string; url: string; } | { filename?: string; id: string; }; providerData?: Record<string, any>; type: "file"; } | ( | { providerData?: Record<string, any>; text: string; type: "input_text"; } | { detail?: string; image?: | string | { id: string; }; providerData?: Record<string, any>; type: "input_image"; } | { file?: | string | { id: string; } | { url: string; }; filename?: string; providerData?: Record<string, any>; type: "input_file"; })[]

The output of the tool call.

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 tool call.

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";
};
actions?: (
| {
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 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"; }

The legacy single action to be performed by the computer.

actions?

( | { 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"; })[]

Batched actions returned by the GA computer tool.

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"


{
callId: string;
id?: string;
output: {
data: string;
providerData?: Record<string, any>;
type: "computer_screenshot";
};
providerData?: Record<string, any>;
type: "computer_call_result";
}
Name Type Default value Description

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.

output

object

ComputerToolOutput

The output of the computer call.

output.data

string

A base64 encoded image data or a URL representing the screenshot.

output.providerData?

Record<string, any>

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

output.type

"computer_screenshot"

providerData?

Record<string, any>

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

type

"computer_call_result"


{
action: {
commands: string[];
maxOutputLength?: number;
timeoutMs?: number;
};
callId: string;
id?: string;
providerData?: Record<string, any>;
status?: "in_progress" | "completed" | "incomplete";
type: "shell_call";
}
Name Type Default value Description

action

object

ShellAction

action.commands

string[]

action.maxOutputLength?

number

action.timeoutMs?

number

callId

string

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"

type

"shell_call"


{
callId: string;
id?: string;
maxOutputLength?: number;
output: object[];
providerData?: Record<string, any>;
type: "shell_call_output";
}
Name Type Description

callId

string

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.

maxOutputLength?

number

output

object[]

providerData?

Record<string, any>

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

type

"shell_call_output"


{
callId: string;
id?: string;
operation: | {
diff: string;
path: string;
type: "create_file";
}
| {
diff: string;
moveTo?: string;
path: string;
type: "update_file";
}
| {
path: string;
type: "delete_file";
};
providerData?: Record<string, any>;
status: "in_progress" | "completed";
type: "apply_patch_call";
}
Name Type Default value Description

callId

string

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.

operation

| { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: string; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }

ApplyPatchOperation

providerData?

Record<string, any>

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

status

"in_progress" | "completed"

type

"apply_patch_call"


{
callId: string;
id?: string;
output?: string;
providerData?: Record<string, any>;
status: "completed" | "failed";
type: "apply_patch_call_output";
}
Name Type Description

callId

string

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.

output?

string

providerData?

Record<string, any>

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

status

"completed" | "failed"

type

"apply_patch_call_output"


{
content: object[];
id?: string;
providerData?: Record<string, any>;
rawContent?: object[];
type: "reasoning";
}
Name Type Description

content

object[]

The user facing representation of the reasoning. Additional information might be in the providerData field.

id?

string

providerData?

Record<string, any>

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

rawContent?

object[]

The raw reasoning text from the model.

type

"reasoning"


{
created_by?: string;
encrypted_content: string;
id?: string;
providerData?: Record<string, any>;
type: "compaction";
}
Name Type Description

created_by?

string

Identifier for the generator of this compaction item.

encrypted_content

string

Encrypted payload returned by the compaction endpoint.

id?

string

Identifier for the compaction item.

providerData?

Record<string, any>

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

type

"compaction"


{
id?: string;
providerData?: Record<string, any>;
type: "unknown";
}
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.

providerData?

Record<string, any>

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

type

"unknown"


undefined

type: string;
RunItemBase.toJSON