Skip to content

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

Open
@frizynn

Description

@frizynn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestion about using the SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions