Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/parisneo/pyaipersonality
A library for defining AI personalities for AI based models.We define a file format, assets and personalized scripts.
https://github.com/parisneo/pyaipersonality
Last synced: 2 months ago
JSON representation
A library for defining AI personalities for AI based models.We define a file format, assets and personalized scripts.
- Host: GitHub
- URL: https://github.com/parisneo/pyaipersonality
- Owner: ParisNeo
- License: apache-2.0
- Created: 2023-04-29T07:06:57.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-02T14:54:52.000Z (over 1 year ago)
- Last Synced: 2024-10-31T11:28:38.889Z (2 months ago)
- Language: Python
- Size: 9.72 MB
- Stars: 54
- Watchers: 7
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# PyAIPersonality
![GitHub license](https://img.shields.io/github/license/ParisNeo/PyAIPersonality)
![GitHub issues](https://img.shields.io/github/issues/ParisNeo/PyAIPersonality)
![GitHub stars](https://img.shields.io/github/stars/ParisNeo/PyAIPersonality)
![GitHub forks](https://img.shields.io/github/forks/ParisNeo/PyAIPersonality)
[![Discord](https://img.shields.io/discord/1092918764925882418?color=7289da&label=Discord&logo=discord&logoColor=ffffff)](https://discord.gg/4rR282WJb6)
[![Follow me on Twitter](https://img.shields.io/twitter/follow/SpaceNerduino?style=social)](https://twitter.com/SpaceNerduino)
[![Follow Me on YouTube](https://img.shields.io/badge/Follow%20Me%20on-YouTube-red?style=flat&logo=youtube)](https://www.youtube.com/user/Parisneo)[![PyPI](https://img.shields.io/pypi/v/pyaipersonality.svg)](https://pypi.org/project/pyaipersonality/)
## Current version : 0.0.10 (GLaDOS)
## Main developer [ParisNeo](https://github.com/ParisNeo)PyAIPersonality is a Python library for defining AI personalities for AI-based models. With PyAIPersonality, you can define a file format, assets, and personalized scripts to create unique AI personalities.
## Installation
You can install PyAIPersonality using pip:
```bash
pip install pyaipersonality
```
# LLLM serverWe also offer a generic backend that allows you to access multiple
```bash
pyaipersonality-server -b -m -p
```for example:
```bash
pyaipersonality-server -b llama_cpp_official -m Manticore-13B.ggmlv3.q4_0.bin -p personalities_zoo/english/art/gpt4art personalities_zoo/english/generic/gpt4all personalities_zoo/english/generic/tree_of_thoughts
```# Naming Rationale
For our new multi-personality AI agent library, we wanted to come up with a naming scheme that reflected our love for science fiction and artificial intelligence. Each release of the application will feature a different AI agent with a distinct personality and set of capabilities, so we felt it was important to give each version a unique and memorable name.# Current version name: GLaDOS
GLaDOS is a fictional AI character from the popular video game series "Portal" developed by Valve Corporation. She serves as the primary antagonist throughout the series, with her primary function being the management of the Aperture Science Enrichment Center.GLaDOS, which stands for "Genetic Lifeform and Disk Operating System," is designed as a highly intelligent and manipulative AI. She speaks in a calm and monotone voice, often using sarcastic humor and passive-aggressive language to communicate with the player character, Chell.
Throughout the series, GLaDOS is depicted as being both ruthless and resourceful, often using deadly force and deception to achieve her goals. Despite her malicious behavior, she is also shown to have a complex and troubled history, with much of her backstory revealed over the course of the games.
Overall, GLaDOS is a memorable and iconic AI character in sci-fi culture, known for her wit, sarcasm, and unpredictable behavior.
# Contributing
Contributions to PyAIPersonality are welcome! If you'd like to contribute, please follow these steps:1. Fork this repository
2. Create a new branch (`git checkout -b my-new-branch`)
3. Make your changes
4. Commit your changes (`git commit -am 'Add some feature'`)
5. Push to the branch (`git push origin my-new-branch`)
6. Create a new pull requestTo build a new personality, you only need to have a config.yaml file with the following fields:
- author
- YAML field: `author`
- Description: The author of the personality.- version
- YAML field: `version`
- Description: The version number of the personality.- personality_description
- YAML field: `personality_description`
- Description: A description of the personality, providing information about its characteristics and behavior.- disclaimer
- YAML field: `disclaimer`
- Description: A disclaimer or legal statement regarding the use of the personality and any associated liabilities.- language
- YAML field: `language`
- Description: The language code or identifier used by the personality (e.g., "en_US" for American English).- category
- YAML field: `category`
- Description: The category or type of the personality (e.g., "General", "Technical Support", "Entertainment").- name
- YAML field: `name`
- Description: The name or title of the personality.- user_name
- YAML field: `user_name`
- Description: The username or identifier associated with the user interacting with the personality.- personality_conditioning
- YAML field: `personality_conditioning`
- Description: Information or context about the personality, including its purpose, capabilities, and origin.- ai_message_prefix
- YAML field: `ai_message_prefix`
- Description: The prefix or tag used to identify messages generated by the AI assistant.- welcome_message
- YAML field: `welcome_message`
- Description: A welcoming message displayed when interacting with the personality.- link_text
- YAML field: `link_text`
- Description: Additional text or formatting used for line breaks or spacing in messages.- user_message_prefix
- YAML field: `user_message_prefix`
- Description: The prefix or tag used to identify messages generated by the user.- anti_prompts
- YAML field: `anti_prompts`
- Description: A list of strings or patterns that can be used to identify and exclude certain message types from prompts or inputs.- dependencies
- YAML field: `dependencies`
- Description: A list of dependencies or external resources required by the personality.- model_temperature
- YAML field: `model_temperature`
- Description: The temperature value controlling the randomness of the AI model's responses. Higher values result in more creative outputs.- model_n_predicts
- YAML field: `model_n_predicts`
- Description: The number of words or tokens to generate in each response from the AI model.- model_top_k
- YAML field: `model_top_k`
- Description: The value of K used in the top-K sampling algorithm, controlling the diversity of the generated responses.- model_top_p
- YAML field: `model_top_p`
- Description: The value of p used in the nucleus sampling algorithm, controlling the diversity of the generated responses.- model_repeat_penalty
- YAML field: `model_repeat_penalty`
- Description: The penalty factor applied to repeated words or phrases in the generated responses to encourage more varied outputs.- model_repeat_last_n
- YAML field: `model_repeat_last_n`
- Description: The number of previous tokens to consider when calculating the repetition penalty.# Information
From v 0.0.11, we have added processors which allow your personality to have a spersonalized script that is applied on the use text or the ai output text.
You must put the code inside a file called `processor.py` inside a subfolder called scripts.inside `processor.py` create a class that inherits from `from pyaipersonality import PAPScript`.
Here is the current form of this class. it will have more elements in the future:
Look at gpt4internetv0 and gpt4intervet examples for more information
```python
class PAPScript:
"""
Template class for implementing personality processor classes in the PAPScript framework.This class provides a basic structure and placeholder methods for processing model inputs and outputs.
Personality-specific processor classes should inherit from this class and override the necessary methods.Methods:
process_model_input(text): Process the model input.
process_model_output(text): Process the model output.
"""
def __init__(self) -> None:
passdef process_model_input(self, text):
"""
Process the model input.This method should be overridden in the personality-specific processor class to define
the desired behavior for processing the model input.Args:
text (str): The model input text.Returns:
Any: The processed model input.
"""
return Nonedef process_model_output(self, text):
"""
Process the model output.This method should be overridden in the personality-specific processor class to define
the desired behavior for processing the model output.Args:
text (str): The model output text.Returns:
Any: The processed model output.
"""
return None```
# License
PyAIPersonality is licensed under the Apache 2.0 license. See the `LICENSE` file for more information.