Skip to content

[BUG] playground prompt saves the wrong response format when validation fails without informing user #6312

@RogerHYang

Description

@RogerHYang

When a python dict is entered (e.g. copied from openai website), the False value (which is capitalized) fails JSON validation (it should be lower case instead), but behind the scene a different response format (the default version) is saved to database without user's knowledge.

Image
{
    "type": "json_schema",
    "json_schema": {
        "name": "math_response",
        "strict": True,
        "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,
        },
    },
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingc/ui

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions