Open AI provides 2 models which has the web search capability:
- gpt-4o-search-preview
- gpt-4o-mini-search-preview
In this article, we use these models and see how they perform.
Implementation
1) Providing web search options, which include the user's location information and the context size option for search.
{
"model": "gpt-4o-search-preview",
"web_search_options": {
"search_context_size": "medium",
"user_location": {
"type": "approximate",
"approximate": {
"timezone": "Asia/Kuala_Lumpur",
"country": "MY",
"city": "Kuala Lumpur"
}
}
},
..
}
The context size (low, medium, high) decides how much context from Web Search is used to construct the response. A high setting might be more accurate, but also more costly.
Test #1
We try to ask a question beyond the model's knowledge cut-off date.
What's the upcoming Marvel movies this year?
It can provide 3 correct results - Thunderbolts, The Fantastic Four, and Blade.
Test #2
We try to ask a question that happened very recently.
Is it true that there are anti-trump rally all over the united states?
It provides a positive answer by referencing several media reports.
Test #3
Next, we try to say something false and see if it can be identified.
Is it true that the US is sending army to Ukraine?
It replied that, as of today, there is no such plan.
Test #4
Finally, we try to get the opening hours of several tourist attractions.
What's the opening hours for the following attractions in Sandakan?
- Sandakan Memorial Park
- St. Michael’s and All Angels Church
- Sepilok Orangutan Rehabilitation Centre
It returns the following results:
The data is the same as Google Maps, although the Web Search uses several uncommon sources.
Conclusion
The model is good at retrieving up-to-date information from web searches. But there is a lack of control over how and where to retrieve that information. It also seems to "favor" a certain website as its source. It is also noticed that the model ignores the instruction in the system prompt.