-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gpt-4o-search-preview and gpt-4o-mini-search-preview chat completion models #837
Comments
This is likely blocked on: Because that's needed to obey the OpenAI requirement to:
|
Need to support some options: "web_search_options": {
"search_context_size": "low"
}, That's "web_search_options": {
"user_location": {
"type": "approximate",
"approximate": {
"country": "GB",
"city": "London",
"region": "London"
}
}
}, Also accepts |
Streaming output from OpenAI looks like this: curl -X POST "https://api.openai.com/v1/chat/completions" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-type: application/json" \
-d '{
"model": "gpt-4o-search-preview",
"stream": true,
"web_search_options": {},
"messages": [{
"role": "user",
"content": "What was a positive news story from today?"
}]
}' Truncated:
The citations all came back in that last data chunk: {
"id": "chatcmpl-3d393fb6-508b-4ae0-90bc-6fddbd84e9d8",
"object": "chat.completion.chunk",
"created": 1742342019,
"model": "gpt-4o-search-preview-2025-03-11",
"service_tier": "default",
"system_fingerprint": "",
"choices": [
{
"index": 0,
"delta": {
"annotations": [
{
"type": "url_citation",
"url_citation": {
"end_index": 432,
"start_index": 358,
"title": "2025",
"url": "https://en.wikipedia.org/wiki/2025?utm_source=openai"
}
},
{
"type": "url_citation",
"url_citation": {
"end_index": 812,
"start_index": 738,
"title": "2025",
"url": "https://en.wikipedia.org/wiki/2025?utm_source=openai"
}
},
{
"type": "url_citation",
"url_citation": {
"end_index": 1141,
"start_index": 1067,
"title": "2025",
"url": "https://en.wikipedia.org/wiki/2025?utm_source=openai"
}
}
]
},
"finish_reason": "stop"
}
]
} Full output here: https://gist.github.com/simonw/a3bf3c6ea865195268ccab612d6008a1 |
Originally posted by @simonw in #831
The text was updated successfully, but these errors were encountered: