Set Agent • AI Agent SDK
set_agent: Set the agent that handles messages.
set_agent
Method
</div>
This is a method of the BotProtocol class in the protocols module.
Set the agent that handles messages.
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%
graph LR
input["Input Data"] --> agent["Agent: set_agent"]
agent --> output["Output Result"]
style agent fill:#8B0000,color:#fff
style input fill:#8B0000,color:#fff
style output fill:#8B0000,color:#fffSignature
def set_agent(agent: 'Agent') -> NoneParameters
ParamField
AgentThe agent to handle incoming messages
Source
View on GitHubpraisonaiagents/bots/protocols.py at line 1100