Skip to content

translation drops OpenAI tool strictness for Anthropic targets #599

Description

@afourniernv

summary

an openai chat request with function.strict: true loses that field when switchyard translates it to an anthropic messages target.

repro

send an openai chat request with a function tool that sets strict: true through an anthropic_messages target. the captured anthropic request contains the tool name, description, and input schema, but no strict field.

i also forwarded the captured request to the live anthropic messages api. it returned http 200, but the call was running without strict schema enforcement because the field had already been removed.

root cause

the openai decoder stores the value in ToolDefinition.strict, but encode_anthropic_tools does not write it into the outbound anthropic tool definition.

expected

preserve true and false, and leave the field out when it was not specified.

found while reviewing #585, which fixes the same loss in the opposite anthropic-to-openai direction.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions