Home Explore Blog CI



ragit

docs/commands/pdl.txt
1afde94fa83ceba49ece9f326c35c6340add72094f6c4a4300000003000008ba
rag-pdl(1)
==========

NAME
----
rag-pdl - Execute a pdl file

SYNOPSIS
--------
[verse]
'rag pdl' <file> [--model <model>] [--models <file>] [--context <file>]
            [--strict] [--escape] [--log <dir>] [--schema <schema>]

DESCRIPTION
-----------
This document explains `rag pdl` command, not the pdl format itself. Run
`rag help pdl-format` to read documents on the file format.

Pdl is a Prompt Description Language, which allows you to write pragmatic prompts.

It executes a pdl file and dumps the result to stdout.

OPTIONS
-------
--model::
        An LLM model to run the prompt with. If the model's not set, it tries
        to guess the model. If it's inside a knowledge-base, it reads the
        configuration of the knowledge-base and uses the default model of the
        knowledge-base.

--models::
        Path to `models.json` file. If it's not given, ragit will try to find
        one. If it's inside a knowledge-base, it'll use `.ragit/models.json`.
        If `~/.config/ragit/models.json` is found, it'll use the file.

--context::
        Path to a json file which adds a context to the prompt. A pdl file is
        pragmatic: you can parameterize your prompt using tera template engine.

--strict::
        By default, ragit ignores errors in pdl files. For example, if there's
        `{{ name }}` in the pdl file but there's no `name` in the context, it
        just turns off the tera renderer.
        If this flag is enabled, the program dies if there's an error while
        parsing the pdl file.

--escape::
        There are some special syntaxes that pdl use. For example, `&lt;|user|>`
        indicates a beginning of a user turn. You might want to include the
        string `&lt;|user|>` in the prompt, instead of using it as a marker. In
        that case, you can write `&amp;lt;|user|>` instead of `&lt;|user|>`, then
        enable this flag. The string won't be parsed by the pdl engine and
        later converted to `&lt;|user|>`.

--log::
        A directory to dump logs. If it's not set, it doesn't dump any log.
        If the directory does not exist, it creates one.

--schema::
        It overrides `&lt;|schema|>` in the pdl file. Run `rag help pdl-format`
        to learn about pdl schemas.

Chunks
68478317 (1st chunk of `docs/commands/pdl.txt`)
Title: Rag-PDL Command Documentation
Summary
The rag-pdl command executes a pdl file, which is a Prompt Description Language, and dumps the result to stdout, with various options to customize the execution, such as specifying a model, context, and logging directory.