This is a base module template for creating personas. You can check out other examples of personas using the CLI commands with the Naptha SDK.
From the official poetry docs:
curl -sSL https://install.python-poetry.org | python3 -
export PATH="/home/$(whoami)/.local/bin:$PATH"
Clone the repo using:
git clone https://github.com/NapthaAI/persona-template
cd persona-template
You can install the module using:
poetry install
source .venv/bin/activate
You can now use the Naptha CLI. For example, list other examples using:
naptha personas
For each persona, you will see a url where you can check out the data.
Change the filename and content of the data/richard.json
file to create your own persona.
When ready, you can push to your personal GitHub, HuggingFace or IPFS. Make sure to change the remote origin:
git remote rm origin
git remote add origin https://github.com/persona_name/persona_template.git
Also add a new module version number using e.g.:
git tag v0.1
git push --tags
naptha personas persona_name -p "description='Persona for <persona_name>' parameters='{name: str, bio: List, lore: List, adjectives: List, topics: List, style: Dict[str, List], messageExamples: List, postExamples: List}' module_url='https://github.com/persona_name/persona_template' module_version='v0.1' module_entrypoint='data/richard.json'"
Make sure that the module_url
is the url of the main repo (e.g the huggingface dataset, github repo, or repo stored on ipfs) and the module_entrypoint
is the path to the file in the dataset (currently can be json or yaml).
naptha personas -d persona_name
naptha run agent:simple_chat_agent -p "tool_name='chat' tool_input_data='who are you?'" --persona_modules "persona_name"