persona
The simulated caller: who they are, what they want, and how they end the call.
An EvalPersona is the instruction the persona LLM runs under, the
LLM service itself, which rides in the eval pipeline, and the context it
runs on, where the bot’s turns are the user messages and its own the
assistant ones. The context offers one tool, end_call, which the
persona calls once its goal is achieved or clearly out of reach; its
success claim is its own view, and the judge decides the outcome.
- class pipecat.evals.persona.EvalPersona(description: str, goal: str, llm: LLMService)[source]
Bases:
objectThe simulated caller: its instruction, its LLM, and the context it runs on.
- __init__(description: str, goal: str, llm: LLMService)[source]
Initialize the persona.
- Parameters:
description – Who the caller is, as free text.
goal – What the caller wants from the call.
llm – The LLM service that plays the caller, run inside the eval pipeline.
- property llm: LLMService
The LLM service that plays the caller, a processor in the eval pipeline.
- property context: LLMContext
The context the persona runs on, with the
end_calltool; empty until the call starts.
- hear(event: dict) LLMContextFrame | None[source]
Take in one of the bot’s events; the frame that has the persona answer, once the bot’s turn is done.
A response the bot gives while one of its function calls is still running is held and joined with the response after the call, so the persona answers the bot’s whole turn rather than its “let me check”. In audio mode the aggregator does this instead.
- Parameters:
event – An event from the stream.
- Returns:
The context frame to push to the persona LLM, or
None.