role_changer
¶
AIRole
¶
Bases: RoleChanger
Change the role of the prompts to assistant.
Parameters:
-
name
(Optional[str]
, default:None
) –The name of the assistant role. Defaults to None.
-
**kwargs
(Any
, default:{}
) –The keyword arguments to pass to the Role
Source code in src/appl/role_changer.py
RoleChanger
¶
RoleChanger(
role: Optional[MessageRole] = None,
_ctx: Optional[PromptContext] = None,
)
Bases: PrinterModifier
The contextual role changer of the prompts.
Parameters:
-
role
(Optional[MessageRole]
, default:None
) –The new role of the prompts. Defaults to None.
-
_ctx
(Optional[PromptContext]
, default:None
) –The prompt context filled automatically by the APPL function.
Source code in src/appl/role_changer.py
SystemRole
¶
Bases: RoleChanger
Change the role of the prompts to system.
Parameters:
-
name
(Optional[str]
, default:None
) –The name of the system role. Defaults to None.
-
**kwargs
(Any
, default:{}
) –The keyword arguments to pass to the RoleChanger constructor.
Source code in src/appl/role_changer.py
ToolRole
¶
Bases: RoleChanger
Change the role of the prompts to tool.
Parameters:
-
name
(Optional[str]
, default:None
) –The name of the tool role. Defaults to None.
-
**kwargs
(Any
, default:{}
) –The keyword arguments to pass to the RoleChanger constructor.
Source code in src/appl/role_changer.py
UserRole
¶
Bases: RoleChanger
Change the role of the prompts to user.
Parameters:
-
name
(Optional[str]
, default:None
) –The name of the user role. Defaults to None.
-
**kwargs
(Any
, default:{}
) –The keyword arguments to pass to the RoleChanger constructor.