cuery.templates#

Jinja templates for common tasks in cuery.

Functions#

resource_path(relpath)

Get the absolute path to a resource file within the cuery package.

load_template(name)

Load a template from a local, relative resource path.

prompt_with_template(prompt, template[, separator, params])

Get a prompt with the chosen template appended.

Package Contents#

cuery.templates.resource_path(relpath)#

Get the absolute path to a resource file within the cuery package.

Parameters:

relpath (str | pathlib.Path)

cuery.templates.load_template(name)#

Load a template from a local, relative resource path.

Parameters:

name (str | pathlib.Path)

Return type:

str

cuery.templates.prompt_with_template(prompt, template, separator='\n', params=None)#

Get a prompt with the chosen template appended.

Parameters:
  • prompt (str)

  • template (str)

  • separator (str)

  • params (dict | None)

Return type:

str