Description
I have noticed an inconsistency between the documentation and the actual implementation of the function_tool
decorator in the OpenAI Agents Python SDK.
Issue Description:
The [official documentation](https://openai.github.io/openai-agents-python/ref/tool/) references a strict_mode
parameter for the function_tool
decorator. However, when attempting to use this parameter in my code, I encounter the following error:
TypeError: function_tool() got an unexpected keyword argument 'strict_mode'
Environment Details:
- Python Version: 3.12.2
- OpenAI Agents SDK Version: Latest (as of March 18, 2025)
Code Example:
from agents import function_tool
@function_tool(strict_mode=True)
async def obtener_clima(ciudad: str) -> str:
"""
Obtains the current weather for a specified city.
Args:
ciudad (str): Name of the city.
Returns:
str: Description of the current weather.
"""
# Logic to retrieve weather information
return f"The weather in {ciudad} is sunny and 25°C."
Error Encountered:
TypeError: function_tool() got an unexpected keyword argument 'strict_mode'
Request for Clarification:
-
Documentation Accuracy: Could you please confirm whether the
strict_mode
parameter is intended to be part of thefunction_tool
decorator? If it is, could you provide guidance on the correct usage or update the documentation to reflect the current implementation? -
Enforcing Parameter Requirements: How can I ensure that functions defined as tools strictly require certain parameters? Specifically, if a user invokes a function without providing all necessary arguments, how can the system prompt them to supply the missing information? I believe the
strict_mode
parameter was intended for this purpose, but its absence in the current implementation leaves this aspect unclear.
Thank you for your attention to this matter. Any guidance or updates would be greatly appreciated.