Chat with AI characters
Project description
Roleplay Bot
Roleplay Bot is a Python chatbot for roleplaying. The bot plays a character with a given name and personality, while you play another character. You provide character names, optional descriptions, and an optional scenario, and the bot generates in-character dialogue and actions.
Example
from roleplay_bot import Bot, BotParameters
# Required parameters
bot_name = "Aria"
anon_name = "Fin"
# Optional parameters
bot_description = "A mischievous forest pixie"
anon_description = "A brave ranger"
scene = "In a misty woodland glade, a chance encounter..."
params = BotParameters(
bot_name=bot_name,
anon_name=anon_name,
bot_description=bot_description,
anon_description=anon_description,
scene=scene,
)
bot = Bot(params)
response = bot.chat("Hello, Aria!")
print(response)
Prerequisites
- Python 3.10+
- Ollama CLI: Install Ollama and ensure it is running on your system. Ollama lets you use local LLMs via a simple Python API.
- llama3.2 model: Pull the
llama3.2model for Ollama using the commandollama pull llama3.2. - (Optional)
uvpackage manager: For convenience, you can use Astral UV to manage dependencies. Install viapip install uvand useuv syncas shown below. Alternatively, you may install dependencies with pip manually.
Installation
- Clone the repository:
git clone https://github.com/rakin406/roleplay_bot.git cd roleplay_bot
- Install Python dependencies:
You need the Ollama Python library. For example:pip install ollama
Alternatively, use theuvmanager:pip install uv uv sync
Usage
Run the main script:
python main.py
You will be prompted for: Bot’s nickname, Your nickname, Bot’s character description (optional), Your character description (optional), and Scenario and lore (optional). For example:
Bot's nickname: Aria
Your nickname: Fin
Bot's character description (Optional): A mischievous forest pixie
Your character description (Optional): A brave ranger
Scenario and lore (Optional): In a misty woodland glade, a chance encounter...
After entering this information, the interactive chat begins.
>> Hello, Aria!
*Aria giggles and flutters a hand* Greetings, kind ranger. What brings you to my glade?
Contributing
Contributions, bug reports, and feature requests are welcome! Feel free to open an issue or submit a pull request on GitHub.
Contact
Rakin Rahman - rakinrahman406@gmail.com
License
This project is released under the MIT License (see the LICENSE file).
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 roleplay_bot-1.0.3.tar.gz.
File metadata
- Download URL: roleplay_bot-1.0.3.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0379fefbc35c9852948da5edc245d71268035d9168081691f6c5430138c7d11c
|
|
| MD5 |
3f3c1c7bf0fcf79d4801e2e451190df1
|
|
| BLAKE2b-256 |
5e45fe26567d0dfcc8baee20a7049dc1a6619963103be12d2182991ae3dac1ae
|
File details
Details for the file roleplay_bot-1.0.3-py3-none-any.whl.
File metadata
- Download URL: roleplay_bot-1.0.3-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bce8d57f32c4445a554028e4c232c370ee74f294b32804e562c10375bee583af
|
|
| MD5 |
c123049f8c89c3379cf9cf56b8944366
|
|
| BLAKE2b-256 |
fdd4dcda2757dc57785a6be93cf3fd41815e363d817e99290850abdfa3ce06a9
|