Metadata-Version: 2.4
Name: persona-chat
Version: 0.1.0
Summary: A sophisticated CLI application for generating authentic multi-turn conversations using 50+ distinct user personas
Home-page: https://github.com/your-org/persona-chat
Author: Persona Chat Team
Author-email: Ahmed Wasfy <oddadmix@gmail.com>
Maintainer-email: Ahmed Wasfy <oddadmix@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/your-org/persona-chat
Project-URL: Documentation, https://persona-chat.readthedocs.io/
Project-URL: Repository, https://github.com/your-org/persona-chat
Project-URL: Bug Tracker, https://github.com/your-org/persona-chat/issues
Keywords: conversation generation,personas,multi-language,CLI,AI,NLP
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: click>=8.1.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: langdetect>=1.0.9
Requires-Dist: polyglot>=16.7.4
Requires-Dist: rich>=13.0.0
Requires-Dist: tqdm>=4.65.0
Requires-Dist: colorama>=0.4.6
Requires-Dist: pathlib2>=2.3.7
Requires-Dist: watchdog>=3.0.0
Requires-Dist: joblib>=1.3.0
Requires-Dist: multiprocessing-logging>=0.3.0
Requires-Dist: openpyxl>=3.1.0
Requires-Dist: xlrd>=2.0.1
Requires-Dist: configparser>=5.3.0
Requires-Dist: jsonschema>=4.17.0
Requires-Dist: structlog>=23.0.0
Requires-Dist: loguru>=0.7.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: sphinx>=6.0.0; extra == "dev"
Requires-Dist: sphinx-rtd-theme>=1.2.0; extra == "dev"
Provides-Extra: ml
Requires-Dist: scikit-learn>=1.3.0; extra == "ml"
Requires-Dist: transformers>=4.30.0; extra == "ml"
Requires-Dist: torch>=2.0.0; extra == "ml"
Provides-Extra: llm
Requires-Dist: openai>=1.0.0; extra == "llm"
Requires-Dist: transformers>=4.30.0; extra == "llm"
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# Persona-Based Conversation Generator CLI

A sophisticated Python CLI application that generates authentic multi-turn conversations using 50+ distinct user personas across multiple languages.

## Features

- **50+ Personas**: Technology, Healthcare, Education, Business, Creative, and Specialized domains
- **Multi-Language Support**: English, Arabic, and more
- **Multi-Turn & Multi-Persona Conversations**: Generate conversations with 3-20 turns, including multi-persona (role-based) dialogues
- **Dynamic Personas**: Personas are created on-the-fly; no static persona files required
- **Batch Generation**: Generate 1-1000 conversations simultaneously with random or domain-specific personas
- **Flexible Export Formats**: Output as JSON, CSV, Markdown, or plain text
- **Quality Analysis**: Built-in conversation quality metrics and validation
- **Cultural Adaptation**: Automatic cultural context and communication style adaptation

## Quick Start

### Installation

```bash
# Clone the repository
git clone <repository-url>
cd persona-chat

# Install dependencies
pip install -r requirements.txt

# Install the package
pip install -e .
```

### Basic Usage

```bash
# Generate a single conversation with a random persona
persona-chat generate

# Use a specific persona with multiple turns
persona-chat generate --persona-name "Senior Software Engineer" --turns 8

# Generate an Arabic conversation
persona-chat generate --language ar --persona-name "مهندس برمجيات" --turns 6

# Batch generation (random personas)
persona-chat batch --conversations 10 --turns 5 --random-personas

# Batch generation (IT/technology personas)
persona-chat batch --conversations 10 --turns 5 --persona-domain technology

# Multi-persona conversation (role-based)
persona-chat generate --multi-persona --persona-names "Teacher,Student,Parent" --persona-roles "primary,participant,observer" --language ar --turns 4
```

## Batch Generation Examples

### Multi-Persona Batch Generation (NEW)
Batch now supports all persona options, including multi-persona, matching the generate command.

```bash
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)
```bash
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)
```bash
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.

<!--
### Arabic Batch with Random Personas (NOT SUPPORTED)
```bash
persona-chat batch --conversations 3 --turns 4 --language ar --personas random --llm-backend openai --llm-model gemma2:2b --llm-api-url http://localhost:11434/v1 --output json --output-filename test_arabic_batch_random
```

### Arabic Batch with IT Personas (Random per Conversation, NOT SUPPORTED)
```bash
persona-chat batch --conversations 3 --turns 4 --language ar --personas technology --llm-backend openai --llm-model gemma2:2b --llm-api-url http://localhost:11434/v1 --output json --output-filename test_arabic_batch_it
```
-->

> **Troubleshooting:**
> - If you see `No valid persona available for conversation generation`, use the `--create-persona` and `--persona-name` options 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`, or `none`)
- `--llm-model`: Model name (e.g., `gemma2:2b` for 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/v1` for Ollama)

### Example: Local Ollama API
```bash
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 openai` and 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-persona` to enable multi-persona mode
- Specify persona names and roles with `--persona-names` and `--persona-roles`
- Example:
  ```bash
  persona-chat generate --multi-persona --persona-names "Artist,Designer,Client" --persona-roles "primary,participant,observer" --language ar --turns 3
  ```

## Documentation

- [Installation Guide](docs/installation.md)
- [Quick Start Guide](docs/quick_start.md)
- [User Guide](docs/user_guide/)
- [Developer Guide](docs/developer_guide/)
- [Examples](docs/examples/)

## 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](docs/developer_guide/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](LICENSE) file for details. 
