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

TypeOf and support for JSON Schema generation for functions #229

Open
vazirim opened this issue Dec 19, 2024 · 2 comments
Open

TypeOf and support for JSON Schema generation for functions #229

vazirim opened this issue Dec 19, 2024 · 2 comments
Labels

Comments

@vazirim
Copy link
Member

vazirim commented Dec 19, 2024

Is your feature request related to a problem? Please describe.
During tool calling, it's useful to define a PDL function that can then be passed as one of the available tools. Today the user has to write the JSON schema corresponding to the PDL function manually. It would be good to automate this.

Describe the solution you'd like
A typeOf() function on any variable will allow users to define a function, assign it to a variable, and obtain its JSON Schema automatically.

For function signatures we also need descriptions. So we need more than typeOf for the tool calling use case.

Describe alternatives you've considered
N/A

Additional context

This issue was inspired by a suggestion from @eloycoto.

@vazirim
Copy link
Member Author

vazirim commented Dec 19, 2024

@mandel we need to figure out how to obtain descriptions for the signatures as well.
In addition to typeof, you had also suggested a way to add consumable comments to function definitions. Could you please document that here?

@eloycoto
Copy link
Contributor

Also function args, in tools we need: type, description and sometimes enums

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

No branches or pull requests

2 participants