Home Explore Blog Models CI



ragit

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

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

SYNOPSIS
--------
[verse]
'rag pdl' <file> [--model <model>] [--models <file>] [--context <file>]
            [--[no-]strict] [--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.

You might want to see how much money it uses with `rag audit` command. You can
do that! In order to do that, you have to run `rag pdl` command in a
knowledge-base, and the knowledge-base's `dump_api_usage` config must be
enabled. Then it will record the api usage to `.ragit/usages.json`. You can
run `rag audit -c pdl` to see the usage

OPTIONS
-------
--model <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 <file>::
        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 <file>::
        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.

--[no-]strict::
        By default, ragit rejects to run a pdl file if there's an error. For
        example, if there's `{{ name }}` in the pdl file but there's no `name`
        in the context, it doesn't call LLM and exits with an error.
        If `--no-strict` is set, it turns off the tera renderer and treats
        `{{ name }}` like a literal string.

--log <dir>::
        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 <schema>::
        It overrides `<|schema|>` in the pdl file. Run `rag help pdl-format`
        to learn about pdl schemas.

Chunks
7f1bd9d3 (1st chunk of `docs/commands/pdl.txt`)
Title: rag-pdl Command
Summary
The rag-pdl command executes a PDL (Prompt Description Language) file, allowing users to write pragmatic prompts and dumping the result to stdout, with various options for customizing the execution, such as specifying a model, context, and logging directory.