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

Add schema, validation for custom prompt YAML files #40

Open
falquaddoomi opened this issue Mar 6, 2024 · 0 comments
Open

Add schema, validation for custom prompt YAML files #40

falquaddoomi opened this issue Mar 6, 2024 · 0 comments
Assignees

Comments

@falquaddoomi
Copy link
Collaborator

(Suggested by @miltondp in #37 (comment))

In PR #37, the custom prompt YAML config files, ai_revision-config.yaml and ai_revision-prompts.yaml are currently ad-hoc validated by the code to look for specific keys and values. As suggested, it would be more robust to have the entire documents' schema described and validated at runtime.

I should mention that it's been a long time since I've done schema validation, but a quick look revealed a few options for schema validation in Python. All of them seem to use Python dictionaries as the common language between different serialization formats (JSON, YAML, etc.) which IMHO is a good idea. Here's the list, ordered by stars on GitHub:

Frankly, from a quick look they all seem very similar. My impression from their docs pages is that Cerberus would be the easiest to work with, so perhaps if there aren't other strong opinions we can just go with that, but I'm of course open to discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant