Skip to main content
ralf-dialogue_logo

ralf-dialogue

Documentation PyPI version License

ralf-dialogue is a Python framework for quickly prototyping dialogue agents that leverage large language models (LLMs), like ChatGPT or GPT-4. It lives in the broader RALF ecosystem, and assumes the use of the ralf library, which provides primitives, constructs, and other utilities for building complex systems around large language models using a desingn paradigm that some parts of the community have begun to call composability.

A word on the broader RALF ecosystem

ralf is a Python library intended to assist developers in creating applications that involve calls to Large Language Models (LLMs). A core concept in ralf is the idea of composability, which allows chaining together LLM calls such that the output of one call can be used to form the prompt of another. ralf makes it easy to chain together both LLM-based and Python-based actions— enabling developers to construct complex information processing pipelines composed of simpler building blocks. Using LLMs in this way can lead to more capable, robust, steerable and inspectable applications.

A general framework for building applications -- including conversational AIs -- that rely on a mix of prompted large language models (LLMs) and conventional Python code and services. This can be considered a powerful form of neuro-symbolic AI. Other frameworks -- such as this one, ralf-dialogue -- build on the core ralf library, adding primatives and components for building conversational agents (or "chatbots") that can interact with users in natural language, leveraging context and accessing external knowledge stores or reasoning engines. Many of these components are still under active construction, and we're always looking for talented contributors.

Quickstart Guide

This quickstart guide is intended to get you up and running with ralf within a few minutes.

Installation

We recommend creating a Conda environment before installing the package:

conda create -n ralf python=3.10
conda activate ralf

Install from PyPI

You may install ralf-dialogue from PyPI using pip:

pip install ralf-dialogue-jhuapl

Install from Source

Alternatively, you can build the package from source. First, clone the Github repository:

git clone https://github.com/jhuapl-fomo/ralf-dialogue.git

Next, install the requirements using pip:

cd ralf-dialogue
pip install -r requirements.txt

Then, build the package using flit and install it using pip:

flit build
pip install .

Or if you would like an editable installation, you can instead use:

pip install -e .

OpenAI Configuration

ralf currently relies on language models provided by OpenAI. In order to access the models, you must store your OpenAI API key as an environment variable by executing the following in bash:

echo "export OPENAI_API_KEY='yourkey'" >> ~/.bashrc
source ~/.bashrc

Running the Demos

To test if installation was successful, try running the demo scripts:

cd demos
python simple_chat.py

This demo script will allow you to converse with a chatbot created using ralf-dialogue. Next, you can delve deeper and explore other features of the library:

python analyze_conversation.py

If the scripts execute successfully, you are good to go!

Metadata

Release files for ralf-dialogue-jhuapl 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ralf-dialogue-jhuapl 0.0.4
File Size Uploaded
ralf-dialogue-jhuapl-0.0.4.tar.gz 192.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ralf-dialogue-jhuapl 0.0.4
File Interpreter ABI Platform
ralf_dialogue_jhuapl-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 206.1 kB

Release files / ralf-dialogue-jhuapl-0.0.4.tar.gz

Download URL ralf-dialogue-jhuapl-0.0.4.tar.gz
Size 192.8 kB
Tags Source
SHA-256 checksum
How to use checksums
502faf192c5ae23fa10e9db8882bb2c8ff290d9e81e133c582df08ee8cd8f27c
BLAKE2b-256 checksum
How to use checksums
ad85ee2109366f4b441aa9eb9d50ff71f229d96f3e11a7de022eef76df51ff34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / ralf_dialogue_jhuapl-0.0.4-py3-none-any.whl

Download URL ralf_dialogue_jhuapl-0.0.4-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a884769983a69a40ff3a6bd57353cd64e19a6d9a93c03b971ccbff4dbf6ad14f
BLAKE2b-256 checksum
How to use checksums
1a76e7517b73ee952708e7dfdfa7b0cee3adcae3f7391f6caf9fb4ab1fea2cc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page