Skip to content

Update Persona

The Tror Gen AI SDK allows you to update existing personas within your application (Note: Persona management is an optional feature). This section guides you through the process of modifying the characteristics of your personas, enabling you to refine their communication style and tailor future chat interactions accordingly.

Why Update Personas?

  • Evolving Needs: As your application or brand voice evolves, you might want to adjust the characteristics of your personas to reflect these changes.

  • Improved Responses: Based on user interactions, you may identify areas where persona responses can be further refined for better clarity or engagement.

  • Maintaining Consistency: Regularly updating persona descriptions ensures consistency in communication style across different chat interactions.

Updating Persona Details:

The update_persona function within the SDK lets you modify existing personas. It takes the following arguments:

  • personaName (str): The existing name of the persona you want to update (required).

  • RoleTemplate (Optional[str]): An updated description outlining the persona's role or area of expertise.

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

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

  • MaxLength (Optional[int]): Define a new 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 updated characteristics or revised guidelines for its responses.

Here's an example of updating a persona:

import trorgenai

trorgenai.update_persona(
    personaName="Customer Service Specialist",
    RoleTemplate="Provides exceptional product support",
    Tone="Friendly and professional"
)

This code snippet updates the "Customer Service Specialist" persona, refining its role description and communication style for a more professional approach while maintaining friendliness.

Interacting with the Updated Persona:

Once you've updated a persona, any chat interactions where this persona is selected will utilize the revised characteristics. The LLM's responses will be tailored according to the new role template, tone, and other specifications provided during the update.

Remember: Refer to the dedicated sections of the documentation related to chat functionalities for details on associating personas with chats and how persona characteristics influence responses.

By keeping your personas updated, you ensure that your chat interactions consistently reflect your evolving needs and brand voice, leading to a more engaging user experience.