[go: up one dir, main page]

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

[JS] dotprompt doesn't propagate input/output schemas in typescript #283

Open
sqrrrl opened this issue May 29, 2024 · 3 comments
Open

[JS] dotprompt doesn't propagate input/output schemas in typescript #283

sqrrrl opened this issue May 29, 2024 · 3 comments
Labels
bug Something isn't working go js

Comments

@sqrrrl
Copy link
Contributor
sqrrrl commented May 29, 2024

Describe the bug

Schemas in dotprompt managed prompts don't propagate through to typescript. Input and output types are 'unknown'.

To Reproduce

Expected behavior
Input/output types are correctly typed.

At a minimum, update documentation to indicate that dotprompt prompts don't expose it.

@sqrrrl sqrrrl added bug Something isn't working js labels May 29, 2024
@mbleigh
Copy link
Collaborator
mbleigh commented Jun 14, 2024

Thanks for the report! This is a known limitation as there's no way for us to dynamically infer a strong type from a text template, but you're right that we should probably document it.

I've filed #417 as one way to help with this problem but you're right that we should at least document it.

@sqrrrl
Copy link
Contributor Author
sqrrrl commented Jun 14, 2024

Figured as much. Like the idea of being able to reference schema defined in code, that would help with the duplication.

Alternate would be a preprocessor/generator to export the types from dotprompt files.

@mbleigh
Copy link
Collaborator
mbleigh commented Jun 14, 2024

Yep a build step is something I've thought about (even played with a bit at one point).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working go js
Projects
None yet
Development

No branches or pull requests

4 participants