Skip to content

Create Persona

The Tror Gen AI SDK empowers you with persona management, an optional feature that lets you create unique virtual identities (personas) for your chat interactions (Note: This functionality is optional). These personas can then be assigned to chats, influencing the communication style and content delivered by the underlying Large Language Models (LLMs).

Imagine having personas like:

  • A supportive "Customer Service Specialist" persona known for being friendly and helpful.

  • A knowledgeable "Technical Support Expert" persona that delivers clear and informative responses.

  • A witty and engaging "Brand Ambassador" persona that reflects your brand's unique voice.

By associating these personas with your chats, you can personalize user experiences and tailor responses according to the chosen persona's characteristics.

Building Your Persona:

The create_persona function within the SDK allows you to define new personas. Here's an overview of the arguments you can provide:

  • personaName (Optional[str]): A clear and concise name for your persona (e.g., "Customer Service Specialist").

  • RoleTemplate (Optional[str]): A description outlining the persona's general role or area of expertise (e.g., "Provides assistance with product inquiries").

  • Tone (Optional[str]): Specify the desired communication style for the persona (e.g., "Friendly", "Informative", "Formal").

  • MinimumLength (Optional[int]): Set a minimum response length for the LLM when this persona is active (in number of words).

  • MaxLength (Optional[int]): Define a maximum response length for the LLM when this persona is active (in number of words).

  • Specifications (Optional[str]): Provide additional details about the persona's characteristics or any specific guidelines for its responses.

  • type (Optional[str]): This argument might be reserved for future functionalities (refer to SDK documentation for updates).

Here's an example of creating a persona:

import trorgenai

trorgenai.create_persona(
    personaName="Customer Service Specialist",
    RoleTemplate="Provides assistance with product inquiries",
    Tone="Friendly and helpful"
)

This code snippet creates a persona named "Customer Service Specialist" with a friendly and helpful tone, suited for assisting users with product-related questions.

Interacting with Your Persona:

Once you've created a persona, you can associate it with your chat interactions within the SDK. The specific implementation for integrating persona selection and its influence on chat responses will be covered in dedicated sections of the documentation related to chat functionalities.

By creating and using personas, you can inject personality and tailor chat interactions within your application, fostering a more engaging and user-friendly experience.

Note: Explore the dedicated sections within this documentation for detailed information on:

Updating existing personas.

Deleting personas you no longer require.