Skip to content

Allow async rendering #23

Description

@rlouf

We should allow async rendering. Ideally the way we tell a template is to be rendered asynchronously is by defining the template as an async function:

from prompts import template

@template
async def prompt_template(var: str):
    return "{{var}}"

rendered = await prompt_template("hi")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions