You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A clear and concise description of what the bug is.
In the function_schema method of the OpenAI Agents SDK, the following line:
func_name = name_override or doc_info.name if doc_info else func.__name__
does not honor name_override when use_docstring_info=False. This happens because of operator precedence in Python. Without parentheses, the expression is interpreted as:
func_name = (name_override or doc_info.name) if doc_info else func.__name__
So when doc_info is None, even if name_override is set, it falls back to func.name.
Debug information
Agents SDK version: (e.g. v0.0.3)
Python version (e.g. Python 3.10)
Repro steps
from agents.function_schema import function_schema
Even when use_docstring_info=False, if name_override is provided, it should be used for func_name.
Suggested Fix:
Update this line:
func_name = name_override or doc_info.name if doc_info else func.name
To this (with parentheses to enforce correct evaluation):
func_name = name_override or (doc_info.name if doc_info else func.name)