Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancy in Documentation: strict_mode Parameter Mentioned but Not Implemented in function_tool Decorator #215

Open
frizynn opened this issue Mar 18, 2025 · 2 comments
Labels
question Question about using the SDK

Comments

@frizynn
Copy link

frizynn commented Mar 18, 2025

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:

  1. Documentation Accuracy: Could you please confirm whether the strict_mode parameter is intended to be part of the function_tool decorator? If it is, could you provide guidance on the correct usage or update the documentation to reflect the current implementation?

  2. 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.

@frizynn frizynn added the question Question about using the SDK label Mar 18, 2025
@rm-openai
Copy link
Collaborator

Oh sorry yeah, the documentation is ahead of the official release. I'll see if I can add a banner or something. This wil be available soon in v0.0.5

@frizynn
Copy link
Author

frizynn commented Mar 18, 2025

Ok, Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about using the SDK
Projects
None yet
Development

No branches or pull requests

2 participants