A CLI tool to create new ragbits applications from templates.
# Create a new ragbits application
uvx create-ragbits-app
- rag: Basic RAG (Retrieval Augmented Generation) application
Templates are stored in the templates/
directory. Each template consists of:
- A directory with the template name
- A
template_config.py
file with template metadata and questions - Template files, with
.j2
extension for files that should be processed as Jinja2 templates
Available variables in templates:
project_name
: Name of the projectpkg_name
: Name of the python packageragbits_version
: Latest version of ragbits- Custom variables from template questions
To create a new template, add a directory under templates/
with:
- Template files (ending in
.j2
) - these will be rendered using Jinja2 - A
template_config.py
file with template metadata and questions
For example, see the templates/example-template
directory.
The template_config.py
file should define a TemplateConfig
class that inherits from TemplateConfig
and creates a config
instance at the bottom of the file:
from create_ragbits_app.template_config_base import (
BaseTemplateConfig,
TextQuestion,
ListQuestion,
ConfirmQuestion
)
class TemplateConfig(TemplateConfig):
name: str = "My Template Name"
description: str = "Description of the template"
questions: List = [
TextQuestion(
name="variable_name",
message="Question to display to user",
default="Default value"
),
# More questions...
]
# Create instance of the config to be imported
config = TemplateConfig()