Mockers¶
relai.mocker.Persona(user_persona, intent=None, starting_message=None, trajectory=None, identifier_in_trajectory='user', tools=None, model='gpt-5-mini', reasoning_effort=None, extra_model_args=None)
¶
Bases: BaseMocker
A mocker class for creating AI personas with specific behaviors and tools. A persona can be used to mimic a particular role by defining a system prompt and optionally equipping it with tools.
Attributes:
| Name | Type | Description |
|---|---|---|
user_persona |
str
|
The description of the persona's characteristics and behavior. |
intent |
str | None
|
The intent or goal of the persona during interactions. |
starting_message |
str | None
|
An optional initial message that the persona will use to start interactions. |
tools |
Optional[list[Tool]]
|
A list of tools that the persona can use. |
Initializes the Persona with a description, intent, optional starting message, tools, and model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_persona
|
str
|
The description of the persona's characteristics and behavior. |
required |
intent
|
str | None
|
The intent or goal of the persona during interactions. |
None
|
starting_message
|
str | None
|
An optional initial message that the persona will use to start interactions. |
None
|
trajectory
|
str | None
|
If provided, the persona will try to mimic the behavior of a certain entity
(defaults to "user") recorded in the trajectory. The entity to mimic can be configured through
|
None
|
identifier_in_trajectory
|
str
|
A string to identify the entity to mimic when a trajectory is provided. Defaults to "user". |
'user'
|
tools
|
Optional[list[Tool]]
|
A list of tools that the persona can use. |
None
|
model
|
str | LitellmModel
|
The AI model to use for simulating the persona's behavior. This can be a string identifier for OpenAI models (e.g. gpt-5-mini) or a LitellmModel (from agents.extensions.models.litellm_model import LitellmModel). For a full list of models supported in LiteLLM, see https://docs.litellm.ai/docs/providers |
'gpt-5-mini'
|
reasoning_effort
|
Literal['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'default'] | None
|
The level of reasoning effort to use for the LLM, if supported by the provider. |
None
|
extra_model_args
|
dict[str, Any] | None
|
Arbitrary keyword arguments to pass directly to the underlying model's API. Note that not all models support all parameters. |
None
|
relai.mocker.MockTool(model='gpt-5-mini', reasoning_effort=None, extra_model_args=None, context=None)
¶
Bases: BaseMocker
A mocker class for simulating the behavior of a tool used by an AI agent.
Initializes the MockTool with an optional model specification.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
str | LitellmModel
|
The AI model to use for simulating the tool's behavior. This can be a string identifier for OpenAI models (e.g. gpt-5-mini) or a LitellmModel (from agents.extensions.models.litellm_model import LitellmModel). For a full list of models supported in LiteLLM, see https://docs.litellm.ai/docs/providers |
'gpt-5-mini'
|
reasoning_effort
|
Literal['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'default'] | None
|
The level of reasoning effort to use for the LLM, if supported by the provider. |
None
|
extra_model_args
|
dict[str, Any] | None
|
Arbitrary keyword arguments to pass directly to the underlying model's API. Note that not all models support all parameters. |
None
|
context
|
str | None
|
Additional context to guide behavior of the mock tool. |
None
|