How to use web search tool? #611
-
How can i use the web search tool ?What should the parameters to be ?
|
Beta Was this translation helpful? Give feedback.
Answered by
iBotPeaches
Jun 20, 2025
Replies: 1 comment
-
$result = OpenAI::chat()->create([
'model' => 'gpt-4o-mini-search-preview',
'messages' => [
[
'role' => 'user',
'content' => 'Could you find 2 articles on french drains for OSHAA certification?',
],
],
'web_search_options' => [
'user_location' => [
'type' => 'approximate',
'approximate' => [
'country' => 'US',
'city' => 'Tampa',
],
],
],
]); Stolen from my own repo here - https://github.com/iBotPeaches/openai-php-laravel-test/blob/master/app/Console/Commands/ChatSearchTest.php For the legacy Chat/Completion endpoint its more about having a web search model and invoking it with |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
iBotPeaches
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Stolen from my own repo here - https://github.com/iBotPeaches/ope…