PersonaHub
- model (BaseModelBackend, optional): The model to use for persona generation and manipulation. (default: :obj:
None
)
init
setitem
- persona (Persona): The persona to add.
delitem
- persona_id (uuid.UUID): The ID of the persona to remove.
getitem
- persona_id (uuid.UUID): The ID of the persona to retrieve.
text_to_persona
- text (str): The input text for which to infer a persona.
- action (str): The action associated with the persona (default is “read”).
persona_to_persona
- persona (Persona): The persona from which to derive related personas.
deduplicate
- embedding_model (BaseEmbedding): The embedding model for similarity compairsion. (default is
None
). - similarity_threshold (float): The similarity threshold for deduplication (default is
0.85
).
_get_embedding
_cosine_similarity
- vec1 (np.ndarray): Vector 1
- vec2 (np.ndarray): Vector 2
_is_similar
- persona1 (Persona1): A persona.
- persona2 (Persona2): The other persona.
- similarity_threshold (float): The threshold on consine similarity to determine whether the two personas are similar.
- embedding_model (BaseEmbedding): The embedding model for similarity compairsion.