ChatBot.persona()

Set a persona that shapes the chatbot’s tone and behavior.

Usage

Source

ChatBot.persona(persona_description)

The persona string becomes the opening identity statement in the constructed system prompt (e.g., “You are {persona_description}”). It occupies the highest-attention primacy position, so it strongly influences all subsequent responses.

Parameters

persona_description: str
A natural-language description of who the chatbot should be. Can range from a short role label ("a helpful assistant") to a multi-sentence character brief.

Returns

ChatBot
The same instance for method chaining.

Examples

import talk_box as tb

bot = tb.ChatBot().persona("a senior Python developer")
bot.get_config()["persona"]
'a senior Python developer'