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

Generate JSON Schema for PHP classes / objects #557

Open
ddebowczyk opened this issue Sep 3, 2024 · 0 comments
Open

Generate JSON Schema for PHP classes / objects #557

ddebowczyk opened this issue Sep 3, 2024 · 0 comments

Comments

@ddebowczyk
Copy link

I have an arbitrary PHP data class. I'd like to use Valinor to generate its representation as JSON Schema. It can be used as an input field for LLM (e.g. OpenAI or Anthropic) endpoint. LLM API responds with JSON following this JSON Schema. Then I can use Valinor deserializer to hydrate PHP object with the values from JSON, validate, etc.

See following example for code illustrating practical use case for such capability in Valinor:
https://docs.instructorphp.com/cookbook/examples/basics/complex_extraction

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