File tree Expand file tree Collapse file tree
agent-framework/user-guide/agents/agent-types Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,21 +170,13 @@ Enable real-time web search capabilities:
170170from agent_framework import HostedWebSearchTool
171171
172172async def web_search_example ():
173- # Configure location for better search results
174- additional_properties = {
175- " user_location" : {
176- " country" : " your-country" , # Country/region code
177- " city" : " your-city" ,
178- }
179- }
180-
181173 agent = OpenAIChatClient(model_id = " gpt-4o-search-preview" ).create_agent(
182174 name = " SearchBot" ,
183175 instructions = " You are a helpful assistant that can search the web for current information." ,
184- tools = HostedWebSearchTool(additional_properties = additional_properties ),
176+ tools = HostedWebSearchTool(),
185177 )
186178
187- result = await agent.run(" What's the current weather in Seattle ?" )
179+ result = await agent.run(" What are the latest developments in artificial intelligence ?" )
188180 print (result.text)
189181```
190182
Original file line number Diff line number Diff line change @@ -378,21 +378,13 @@ Enable real-time web search capabilities:
378378from agent_framework import HostedWebSearchTool
379379
380380async def web_search_example ():
381- # Configure location for better search results
382- additional_properties = {
383- " user_location" : {
384- " country" : " your-country" , # Country/region code
385- " city" : " your-city" ,
386- }
387- }
388-
389381 agent = OpenAIResponsesClient().create_agent(
390382 name = " SearchBot" ,
391383 instructions = " You are a helpful assistant that can search the web for current information." ,
392- tools = HostedWebSearchTool(additional_properties = additional_properties ),
384+ tools = HostedWebSearchTool(),
393385 )
394386
395- result = await agent.run(" What's the current weather in Seattle ?" )
387+ result = await agent.run(" What are the latest developments in artificial intelligence ?" )
396388 print (result.text)
397389```
398390
You can’t perform that action at this time.
0 commit comments