A sophisticated CLI application for generating authentic multi-turn conversations using 50+ distinct user personas
Project description
Persona-Based Conversation Generator CLI
A sophisticated Python CLI application that generates authentic multi-turn conversations using 50+ distinct user personas across multiple languages.
Installation
Option 1: Install from PyPI (Recommended)
You can install the package directly from PyPI without cloning the repository:
pip install persona-chat
After installation, the persona-chat CLI command will be available globally:
persona-chat --help
You can now use all CLI features as described below, including batch and multi-persona generation.
Option 2: Clone the Repository (Development/Latest)
git clone <repository-url>
cd persona-chat
# Install dependencies
pip install -r requirements.txt
# Install the package in editable mode
pip install -e .
Usage
After installation (from PyPI or from source), you can use the CLI:
persona-chat generate --help
persona-chat batch --help
See below for example commands and advanced usage.
Batch Generation Examples
Multi-Persona Batch Generation (NEW)
Batch now supports all persona options, including multi-persona, matching the generate command.
persona-chat batch --conversations 3 --turns 3 --language ar --multi-persona --persona-names "Teacher,Student,Parent" --persona-roles "primary,participant,observer" --llm-backend openai --llm-model gemma2:2b --llm-api-url http://localhost:11434/v1 --output json --output-filename test_multi_persona_batch
Arabic Batch with a Single Dynamic Technology Persona (All Conversations)
persona-chat batch --conversations 3 --turns 4 --language ar --create-persona --persona-name "مهندس برمجيات" --persona-role "مهندس برمجيات" --persona-domain technology --persona-expertise expert --persona-communication-style technical --llm-backend openai --llm-model gemma2:2b --llm-api-url http://localhost:11434/v1 --output json --output-filename test_arabic_batch_dynamic_it
Multi-Persona Conversation (Single)
persona-chat generate --multi-persona --persona-names "Chef,Waiter,Customer" --persona-roles "primary,participant,observer" --language ar --turns 3 --llm-backend openai --llm-model gemma2:2b --llm-api-url http://localhost:11434/v1 --output markdown --output-filename test_multi_persona_restaurant
Note: All persona options (including multi-persona, persona names, roles, and dynamic persona creation) are now supported in both batch and generate commands.
Troubleshooting:
- If you see
No valid persona available for conversation generation, use the--create-personaand--persona-nameoptions as shown above.- If you want random personas per conversation, you must restore the static persona files or update the code to support dynamic random persona generation.
Export Formats
--output json(default): Structured JSON--output csv: Tabular CSV--output markdown: Human-readable Markdown--output text: Plain text
LLM Backend Support (OpenAI, Ollama, Transformers)
You can use OpenAI-compatible APIs (including local Ollama) or HuggingFace Transformers as the backend for all message generation.
Configuration
--llm-backend: Choose the backend (openai,transformers, ornone)--llm-model: Model name (e.g.,gemma2:2bfor Ollama)--llm-api-key: (For OpenAI) Your OpenAI API key (use any dummy value for local Ollama)--llm-api-url: (For OpenAI) Custom API URL for self-hosted or alternative OpenAI-compatible APIs (e.g.,http://localhost:11434/v1for Ollama)
Example: Local Ollama API
persona-chat generate --llm-backend openai --llm-model gemma2:2b --llm-api-key dummy --llm-api-url http://localhost:11434/v1 --persona-name "Senior Software Engineer" --turns 5
Notes
- All user and assistant messages are generated using the selected LLM backend if enabled.
- For local Ollama, use
--llm-backend openaiand provide a dummy API key. - For Transformers, the model must be available locally or downloadable from HuggingFace.
- You can set defaults in a config file or via environment variables for convenience.
Multi-Persona Conversations
- Use
--multi-personato enable multi-persona mode - Specify persona names and roles with
--persona-namesand--persona-roles - Example:
persona-chat generate --multi-persona --persona-names "Artist,Designer,Client" --persona-roles "primary,participant,observer" --language ar --turns 3
Documentation
Project Structure
persona-chat/
├── persona_chat/ # Main application package
├── config/ # Configuration files
├── output/ # Output files
├── tests/ # Test suite
├── docs/ # Documentation
├── examples/ # Example files
└── tools/ # Development tools
Contributing
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file persona_chat-0.1.1.tar.gz.
File metadata
- Download URL: persona_chat-0.1.1.tar.gz
- Upload date:
- Size: 69.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee7caa881fd0c71a8c9e6ae89f3a728dce1a7b0db8de471df6374c32857c7f78
|
|
| MD5 |
5978872b2e269115cc756fdfb445b0be
|
|
| BLAKE2b-256 |
6b27cf6e8a8d3615c49415652d35d59fcdec69b27554dea87f5d1d71b8c0258f
|
File details
Details for the file persona_chat-0.1.1-py3-none-any.whl.
File metadata
- Download URL: persona_chat-0.1.1-py3-none-any.whl
- Upload date:
- Size: 83.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0350daa3bd00ce640f51160dd632b03c140c9132a2d437c182565cb272012396
|
|
| MD5 |
3fa7e2df29b0d3cb5116f2f22e573501
|
|
| BLAKE2b-256 |
00eec83f80fd60bc2159139c5bbaa6de547d5abb9277304f9eb4f9a355a69eab
|