Module naptha_sdk.modules.agent

Classes

class Agent (deployment, *args, **kwargs)
Expand source code
class Agent:
    def __init__(self, 
        deployment, 
        *args,
        **kwargs
    ):
        self.deployment = deployment
        self.agent_node = NodeClient(self.deployment.node)

    async def call_agent_func(self, module_run_input: AgentRunInput, *args, **kwargs):
        logger.info(f"Running agent on worker node {self.agent_node.node_url}")
        
        agent_run = await self.agent_node.run_module(module_type="agent", run_input=module_run_input.model_dict())
        return agent_run

Methods

async def call_agent_func(self,
module_run_input: AgentRunInput,
*args,
**kwargs)
Expand source code
async def call_agent_func(self, module_run_input: AgentRunInput, *args, **kwargs):
    logger.info(f"Running agent on worker node {self.agent_node.node_url}")
    
    agent_run = await self.agent_node.run_module(module_type="agent", run_input=module_run_input.model_dict())
    return agent_run