This is a getting started guide for users of the alpha version. This guide will cover:
- Installation of the NeMo Guardrails toolkit;
- Creation of a basic rails application;
- Using the interactive chat;
- Calling actions from flows.
- First, create a folder for your project e.g.
my_assistant
.
> mkdir my_assistant
> cd my_assistant
- Create a virtual environment.
> python3 -m venv venv
- Activate the virtual environment.
> source venv/bin/activate
- Install NeMo Guardrails using pip.
> pip install nemoguardrails
- If you want to use OpenAI, also install the
openai
package. And make sure that you have theOPENAI_API_KEY
environment variable set.
> pip install openai
> export OPENAI_API_KEY=...
- You should now be able to invoke the
nemoguardrails
CLI.
> nemoguardrails --help
Usage: nemoguardrails [OPTIONS] COMMAND [ARGS]...
Options:
--install-completion [bash|zsh|fish|powershell|pwsh]
Install completion for the specified shell.
--show-completion [bash|zsh|fish|powershell|pwsh]
Show completion for the specified shell, to
copy it or customize the installation.
--help Show this message and exit.
Commands:
actions-server Starts a NeMo Guardrails actions server.
chat Starts an interactive chat session.
server Starts a NeMo Guardrails server.
You can also use the --help
flag to learn more about each of the nemoguardrails
commands:
> nemoguardrails actions-server --help
Usage: nemoguardrails actions-server [OPTIONS]
Starts a NeMo Guardrails actions server.
Options:
--port INTEGER The port that the server should listen on. [default: 8001]
--help Show this message and exit.
> nemoguardrails chat --help
Usage: nemoguardrails chat [OPTIONS]
Starts an interactive chat session.
Options:
--config TEXT Path to a directory containing configuration files
to use. Can also point to a single configuration
file. [default: config]
--verbose / --no-verbose If the chat should be verbose and output the
prompts [default: no-verbose]
--help Show this message and exit.
> nemoguardrails server --help
Usage: nemoguardrails server [OPTIONS]
Starts a NeMo Guardrails server.
Options:
--port INTEGER The port that the server should listen on. [default: 8000]
--help Show this message and exit.
- Check out the
hello-world
example. - Explore more examples in
nemoguardrails/examples
folder. - Review the user guide!