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

tighten a bit JSONSchema type #661

Open
pelikhan opened this issue Aug 26, 2024 · 2 comments
Open

tighten a bit JSONSchema type #661

pelikhan opened this issue Aug 26, 2024 · 2 comments

Comments

@pelikhan
Copy link
Contributor

Great project! I was playing with adding just enough support in genaiscript to use the agentic function in my script (microsoft/genaiscript#652)

The only issue is a silly typing error because JSONSchema is too loose (

// TODO: use a more specific type
) and does not match my own type definition (yay we all have a copy of those)

I was wondering if you could beef up that definition.

@transitive-bullshit
Copy link
Owner

I'm definitely open to this, though I kind of like being a bit flexible on the JSON Schema types to match OpenAI's ResponseFormatJSONSchema and FunctionParameters types and Vercel AI SDK's CoreTool.Parameters type.

Can you point me to the corresponding type in GenAIScript's source for reference?

@pelikhan
Copy link
Contributor Author

You'll see that it's a smallish subset of what JSON schemas can do, but mostly what's needed and supported when working with LLMs.

https://github.com/microsoft/genaiscript/blob/main/packages/core/src/types/prompt_template.d.ts#L781

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

2 participants