Skip to content

How to use web search tool? #611

Closed Answered by iBotPeaches
YusufDurmaz asked this question in Q&A
Discussion options

You must be logged in to vote
        $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/ope…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by iBotPeaches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants