Commit 653abc5
authored
### Summary
This pull request fixes [issue
openai#892](openai#892) by
adding a missing docstring to the `fetch_user_age` tool function in
`docs/context.md`.
### Problem
Many non-OpenAI LLMs (such as Claude, Gemini, Mistral, etc.) are unable
to use the `fetch_user_age` function because it lacks a docstring. As a
result, they return responses like:
> "I cannot determine the user's age because the available tools lack
the ability to fetch user-specific information."
### Changes Made
- Added a one-line docstring to the `fetch_user_age` function
- Improved return statement to match expected tool output
```python
@function_tool
async def fetch_user_age(wrapper: RunContextWrapper[UserInfo]) -> str:
"""Fetch the age of the user. Call this function to get user's age information."""
return f"The user {wrapper.context.name} is 47 years old"
1 parent 94f8035 commit 653abc5
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
0 commit comments