masci / banks

LLM prompt language based on Jinja. Banks provides tools and functions to build prompts text and chat messages from generic blueprints. It allows attaching metadata to prompts to ease their management, and versioning is first-class citizen. Banks provides ways to store prompts on disk along with their metadata.
MIT License
63 stars 5 forks source link

feat: add completion extension #19

Closed masci closed 1 month ago

masci commented 1 month ago

completion can be used to send to the LLM the content of the block in form of messages.

The rendered value of the block can be used as is but it's usually more useful to assign it to a variable and access it from another section of the prompt.

Example:

        {% set response %}
        {% completion model="gpt-3.5-turbo-0125" %}
        {% chat role="user" %}You are a helpful assistant{% endchat %}
        {% endcompletion %}
        {% endset %}

        {# output the response content #}
        {{ response }}
coveralls commented 1 month ago

Coverage Status

coverage: 94.541% (+3.1%) from 91.416% when pulling 2104c5c034df191b4da63aa4db84dedc011c8b7f on massi/completion into 27e57eaa288af143db8a1d931a81ecebcbb9435b on main.