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.8.tar.gz (59.6 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.8-py3-none-any.whl (57.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nardial-0.1.8.tar.gz
  • Upload date:
  • Size: 59.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nardial-0.1.8.tar.gz
Algorithm Hash digest
SHA256 84f3b1cc7228a773559188dcd64a886cda107f6a95aae4db1086b2dd7585e016
MD5 13203b36c6ce48d9abd31b480f683e20
BLAKE2b-256 8876b80d50aacd95bea3504c89196d8193e77ea1c2890a60654a9a20efb6774b

See more details on using hashes here.

Provenance

The following attestation bundles were made for nardial-0.1.8.tar.gz:

Publisher: publish.yml on Social-AI-VU/NarDialPy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: nardial-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 57.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nardial-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 0b904b177dd50c65560b305e05366b6c28914e2b4aedd7ef4ae927d98ede0f7d
MD5 aca6ed31cea1db2fd97d3a9273173d56
BLAKE2b-256 a2926d1da98eda823e831839d50296138f32d41b283ed0181cff205e83594071

See more details on using hashes here.

Provenance

The following attestation bundles were made for nardial-0.1.8-py3-none-any.whl:

Publisher: publish.yml on Social-AI-VU/NarDialPy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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