Skip to content

[Bug]: OpenAI Responses API should not enforce strict-tools to true. #398

@ycastorium

Description

@ycastorium

Provider (if applicable)

openai

Model (if applicable)

No response

Bug Description

Right now, the OpenAI Responses API is enforcing strict-mode to true, the users should have the option to use the non-strict mode.

Reproduction Code

defp encode_tool_for_responses_api(%ReqLLM.Tool{} = tool) do
    schema = ReqLLM.Tool.to_schema(tool)
    function_def = schema["function"]
    params = normalize_parameters_for_strict(function_def["parameters"])

    %{
      "type" => "function",
      "name" => function_def["name"],
      "description" => function_def["description"],
      "parameters" => params,
      "strict" => true
    }
  end

Expected Behavior

Strict should be the one sent by the user

Actual Behavior

Strict is always true

Environment

  • ReqLLM: 1.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions