BaseInputsUnion1 - TypeScript SDK

BaseInputsUnion1 type definition

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Supported Types

models.BaseInputsMessage

1const value: models.BaseInputsMessage = {
2 content: "<value>",
3 role: "user",
4};

models.OpenAIResponseInputMessageItem

1const value: models.OpenAIResponseInputMessageItem = {
2 content: [
3 {
4 text: "Hello, how are you?",
5 type: "input_text",
6 },
7 ],
8 id: "msg-abc123",
9 role: "user",
10};

models.OpenAIResponseFunctionToolCallOutput

1const value: models.OpenAIResponseFunctionToolCallOutput = {
2 callId: "call-abc123",
3 output: "{\"temperature\":72,\"conditions\":\"sunny\"}",
4 type: "function_call_output",
5};

models.OpenAIResponseFunctionToolCall

1const value: models.OpenAIResponseFunctionToolCall = {
2 arguments: "{\"location\":\"San Francisco\"}",
3 callId: "call-abc123",
4 name: "get_weather",
5 type: "function_call",
6};

models.OutputItemImageGenerationCall

1const value: models.OutputItemImageGenerationCall = {
2 id: "imagegen-abc123",
3 result:
4 "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
5 status: "completed",
6 type: "image_generation_call",
7};

models.OutputMessage

1const value: models.OutputMessage = {
2 content: [
3 {
4 text: "Hello! How can I help you today?",
5 type: "output_text",
6 },
7 ],
8 id: "msg-abc123",
9 role: "assistant",
10 type: "message",
11};

models.OpenAIResponseCustomToolCall

1const value: models.OpenAIResponseCustomToolCall = {
2 callId: "call-abc123",
3 input: "*** Begin Patch\n*** End Patch",
4 name: "apply_patch",
5 type: "custom_tool_call",
6};

models.OpenAIResponseCustomToolCallOutput

1const value: models.OpenAIResponseCustomToolCallOutput = {
2 callId: "call-abc123",
3 output: "patch applied successfully",
4 type: "custom_tool_call_output",
5};

models.ApplyPatchCallItem

1const value: models.ApplyPatchCallItem = {
2 callId: "call_abc123",
3 operation: {
4 diff: "@@ function main() {\n+ console.log(\"hi\");\n }",
5 path: "/src/main.ts",
6 type: "update_file",
7 },
8 status: "completed",
9 type: "apply_patch_call",
10};

models.ApplyPatchCallOutputItem

1const value: models.ApplyPatchCallOutputItem = {
2 callId: "call_abc123",
3 status: "completed",
4 type: "apply_patch_call_output",
5};