Skip to main content

Nardial Dialog System

Project description

NarDialPy

NarDialPy is a Python framework for building and running narrative dialogs.

It combines:

  • Dialog blocks written as JSON (functional, narrative, and chitchat dialogs)
  • A session manager that executes a chosen dialog agenda
  • Voice / NLU / LLM services (Dialogflow, Google TTS, OpenAI GPT via social-interaction-cloud)

The repository includes a complete demo conversation in the examples/ folder that shows how these parts work together.

Repository layout

  • src/nardial/ – core runtime (dialog loading, move execution, session flow)
  • examples/demo_general_conversation.py – runnable demo entrypoint
  • examples/dialogs.json – demo dialogs (conversation content)
  • web/authoring/ – browser-based dialog authoring UI
  • tests/ – unit tests for move handling and dialog behavior

How the demo conversation works

The demo script (examples/demo_general_conversation.py) creates a ConversationAgent, then runs a fixed agenda through SessionManager:

session_agenda = ["greeting", "hero_can_dream_1", "dream12", "goodbye"]

Those dialog IDs are resolved from examples/dialogs.json, which contains declarative move sequences such as:

  • say
  • ask_open
  • ask_yesno
  • ask_options
  • branch (outcome-based branching)

This makes it easy to edit conversation behavior without changing Python code.

Quick start (demo)

1) Install

From the repository root:

pip install -e .

Install/update cloud integrations used by the demo:

pip install --upgrade social-interaction-cloud[dialogflow,google-tts,openai-gpt]

2) Configure credentials

  1. Create Dialogflow credentials and save to: conf/dialogflow/google_keyfile.json
  2. Create an OpenAI API key and save to: conf/openai/.openai_env

Example .openai_env:

OPENAI_API_KEY="your key"

Never commit or share credential files.

3) Configure the Dialogflow agent

In your Dialogflow agent:

  • Remove default intents.
  • Go to Settings → Import and Export.
  • Import resources/droomrobot_dialogflow_agent.zip to load the intents/entities used by the demo.

4) Start required services

In separate terminals:

conf/redis/redis-server.exe conf/redis/redis.conf
run-dialogflow
run-google-tts
run-gpt

5) Run the demo conversation

From examples/:

python demo_general_conversation.py

Use a supported device configuration in the script (desktop by default).

Customizing conversations

  • Edit examples/dialogs.json to add or modify dialog blocks.
  • Update the session_agenda in examples/demo_general_conversation.py to change the order/content of a run.
  • Use web/authoring/ if you prefer editing dialogs through the browser UI.

Development

Run tests from the repository root:

python -m pytest -q

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nardial-0.1.7.tar.gz (72.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nardial-0.1.7-py3-none-any.whl (57.6 kB view details)

Uploaded Python 3

File details

Details for the file nardial-0.1.7.tar.gz.

File metadata

  • Download URL: nardial-0.1.7.tar.gz
  • Upload date:
  • Size: 72.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.12

File hashes

Hashes for nardial-0.1.7.tar.gz
Algorithm Hash digest
SHA256 31738114aa1078520625fad025345d5cd744d489c043ac7f214027f5746b8ea2
MD5 410ace95e8e3a254776d3ac4af286229
BLAKE2b-256 e4454efcb7cac5fb604c2d77bafa78fca911291a792ecf8e62295fa5c65be76a

See more details on using hashes here.

File details

Details for the file nardial-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: nardial-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 57.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.12

File hashes

Hashes for nardial-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 8b5d928603e673210832981071b941751802f6835fa1fe798b7125f904fcfe04
MD5 7dc600af96fce991d16dcb422e2adf10
BLAKE2b-256 e70da7ed5e9a79268311b92818110b3829ea80db42f0db0673db2579748d8fa4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page