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

Jinja support? #82

Open
samuelcolvin opened this issue Nov 21, 2024 · 1 comment
Open

Jinja support? #82

samuelcolvin opened this issue Nov 21, 2024 · 1 comment

Comments

@samuelcolvin
Copy link
Member

Instructor (and other libraries) support jinja templates for system prompt building, see here.

It would be pretty easily for us to support, then again it doesn't need to be build into the library, it just be implemented by the user.

We should at least add an example of how to do this.

Should we add formal support for it? If so what should the API be?

@samuelcolvin
Copy link
Member Author

Worth saying that Jinja is inherently not type-safe, and you can often get the same result with type safe code, e.g.

    ...
    return f"""
blah
blah blah
{'\n'.join(thing.foo for thing in deps.things}
...
"""

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