Skip to content

Commit 1246ff8

Browse files
refactor: rename search_tool for clarity (#81)
The function originally named `search_tool` has a specific purpose of fetching weather information, but the name was too generic. Renaming it to `get_weather` increases readability and maintainability for future developers. Co-authored-by: Adarsh N <[email protected]>
1 parent 83e1b36 commit 1246ff8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/agents-sdk-python/example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ async def main():
5454

5555
# Define weather tool
5656
@function_tool
57-
async def search_tool(location: str) -> str:
57+
async def get_weather(location: str) -> str:
5858
return f"The weather in {location} is sunny."
5959

6060
# Create agent
6161
agent = Agent(
6262
name="My Agent",
6363
instructions="You are a helpful assistant.",
64-
tools=[search_tool],
64+
tools=[get_weather],
6565
model="gpt-oss:20b-test",
6666
mcp_servers=[mcp_server],
6767
)

0 commit comments

Comments
 (0)