Skip to content

Allow async rendering #23

@rlouf

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")

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