Skip to content

Commit fecc945

Browse files
committed
web search fix
1 parent f6f1bfe commit fecc945

2 files changed

Lines changed: 4 additions & 20 deletions

File tree

agent-framework/user-guide/agents/agent-types/openai-chat-completion-agent.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,21 +170,13 @@ Enable real-time web search capabilities:
170170
from agent_framework import HostedWebSearchTool
171171

172172
async 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

agent-framework/user-guide/agents/agent-types/openai-responses-agent.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -378,21 +378,13 @@ Enable real-time web search capabilities:
378378
from agent_framework import HostedWebSearchTool
379379

380380
async 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

0 commit comments

Comments
 (0)