| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
This document describes the actual JSON structure sent to the OpenAI API in the input field of OpenAIRequest.
The input field is a JSON array containing one of three object types:
These are converted from OpenAIChatMessage internal format and cleaned before transmission (see lines 485-494).
User and assistant messages sent as OpenAIMessage:
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "Hello, analyze this image"
},
{
"type": "input_image",
"image_url": "data:image/png;base64,iVBORw0KG..."
}
]
}Key Points:
{
"type": "input_text",
"text": "message content here"
}{
"type": "input_image",
"image_url": "data:image/png;base64,..."
}{
"type": "input_file",
"file_data": "JVBERi0xLjQKJeLjz9M...",
"filename": "document.pdf"
}{
"type": "function_call",
"call_id": "call_abc123",
"name": "search_files",
"arguments": {"query": "test"}
}Tool calls from the model sent as OpenAIFunctionCallInput:
{
"type": "function_call",
"call_id": "call_abc123",
"name": "search_files",
"arguments": "{\"query\":\"test\",\"path\":\"./src\"}"
}Key Points:
Tool execution results sent as OpenAIFunctionCallOutputInput:
{
"type": "function_call_output",
"call_id": "call_abc123",
"output": "Found 3 files matching query"
}Key Points:
{
"type": "function_call_output",
"call_id": "call_abc123",
"output": "Result text here"
}{
"type": "function_call_output",
"call_id": "call_abc123",
"output": [
{
"type": "input_image",
"image_url": "data:image/png;base64,..."
}
]
}{
"type": "function_call_output",
"call_id": "call_abc123",
"output": "{\"ok\":\"false\",\"error\":\"File not found\"}"
}{
"model": "gpt-4o",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "What files are in src/?"
}
]
},
{
"type": "function_call",
"call_id": "call_xyz789",
"name": "list_files",
"arguments": "{\"path\":\"src/\"}"
},
{
"type": "function_call_output",
"call_id": "call_xyz789",
"output": "main.go\nutil.go\nconfig.go"
},
{
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "The src/ directory contains 3 files: main.go, util.go, and config.go"
}
]
}
],
"stream": true,
"max_output_tokens": 4096
}Before transmission, internal fields are removed (cleanup code):
This ensures the API receives only the fields it expects.
| Back | FazBrowse Home | New Git URL |