Skip to content

Improve structured outputs and tool calling experience #139

Closed
@nathanfallet

Description

@nathanfallet

As we can see on https://platform.openai.com/docs/guides/structured-outputs?context=without_parse (see How to use > Manual schema > Step 2), the payload looks something like this:

{
      "type": "json_schema",
      "json_schema": {
          "name": "math_response",
          "schema": {
              "type": "object",
              "properties": {
                  "steps": {
                      "type": "array",
                      "items": {
                          "type": "object",
                          "properties": {
                              "explanation": {"type": "string"},
                              "output": {"type": "string"}
                          },
                          "required": ["explanation", "output"],
                          "additionalProperties": false
                      }
                  },
                  "final_answer": {"type": "string"}
              },
              "required": ["steps", "final_answer"],
              "additionalProperties": false
          },
          "strict": true
      }

Currently, only additionalProperties is available at the schema level (no type, properties, items, required, ...)

Is this still WIP, or any plan about this? I'm also ok to open a PR to add it if it can help (and no one is already working on it)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions