Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[playground][ui] openai tool schemas containing anyOf are parsed as invalid #5921

Closed
Tracked by #5698
axiomofjoy opened this issue Jan 7, 2025 · 1 comment · Fixed by #5927
Closed
Tracked by #5698

[playground][ui] openai tool schemas containing anyOf are parsed as invalid #5921

axiomofjoy opened this issue Jan 7, 2025 · 1 comment · Fixed by #5927
Assignees
Labels

Comments

@axiomofjoy
Copy link
Contributor

axiomofjoy commented Jan 7, 2025

anyOf is allowed in tools schemas for OpenAI, but is parsed as being invalid in playground.

Screenshot 2025-01-07 at 12 29 21 AM

Schema:

{
    "type": "function",
    "function": {
        "name": "create_booking",
        "description": "Creates a booking on the user's behalf",
        "parameters": {
            "type": "object",
            "properties": {
                "place_id": {
                    "type": "string",
                    "description": "The ID of the place to create a booking for"
                },
                "booking_details": {
                    "anyOf": [
                        {
                            "type": "object",
                            "description": "Restaurant booking with specific date and time",
                            "properties": {
                                "date": {
                                    "type": "string",
                                    "description": "The date of the booking, in format YYYY-MM-DD"
                                },
                                "time": {
                                    "type": "string",
                                    "description": "The time of the booking, in format HH:MM"
                                }
                            },
                            "required": ["date", "time"]
                        },
                        {
                            "type": "object",
                            "description": "Hotel booking with specific check-in and check-out dates",
                            "properties": {
                                "check_in": {
                                    "type": "string",
                                    "description": "The check-in date of the booking, in format YYYY-MM-DD"
                                },
                                "check_out": {
                                    "type": "string",
                                    "description": "The check-out date of the booking, in format YYYY-MM-DD"
                                }
                            },
                            "required": ["check_in", "check_out"]
                        }
                    ]
                }
            },
            "required": ["place_id", "booking_details"],
            "additionalProperties": false
        }
    }
}

Example question:

Book a table at place ID '12345' for January 15, 2025, at 7:00 PM.
@github-project-automation github-project-automation bot moved this to 📘 Todo in phoenix Jan 7, 2025
@axiomofjoy axiomofjoy changed the title [playground][ui] tool schemas containing anyOf are parsed as invalid [playground][ui] openai tool schemas containing anyOf are parsed as invalid Jan 7, 2025
@dosubot dosubot bot added the c/ui label Jan 7, 2025
@axiomofjoy
Copy link
Contributor Author

@cephalization Noticed this while adding backend validation for tool schemas.

@cephalization cephalization self-assigned this Jan 7, 2025
@cephalization cephalization moved this from 📘 Todo to 👨‍💻 In progress in phoenix Jan 7, 2025
@cephalization cephalization moved this from 👨‍💻 In progress to 🔍. Needs Review in phoenix Jan 7, 2025
@github-project-automation github-project-automation bot moved this from 🔍. Needs Review to ✅ Done in phoenix Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants