Skip to content

no support for strict tool schema definitions #805

@simllll

Description

@simllll

Describe the bug

currently it's not possible to set "strict: true" for tool definitions. in the python versoin it can be set, it's even true by default.

see also open ai function-calling: https://platform.openai.com/docs/guides/function-calling#defining-functions

and the helper method to get from zod jsons to strict schemas:
https://github.com/openai/openai-node/blob/7a97bfcf1ea071bc605c654161cc0e4867d22960/src/lib/transform.ts#L38
(ensureStrictJsonSchema helper)

what is missing:

  1. make the strict prop configurable (and set it to true by default?)
  2. wrap the toJsonschema in the ensurestrict json schema function .. see: https://github.com/openai/openai-node/pull/1666/files#diff-3a1140710d3b12cdf0bbe73ea5c769ef4d3452a10bcb4d46bc696401ea22e2bbR33

Relevant log output

No response

Describe your environment

Minimal reproducible example

No response

Additional information

No response

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