MCPcopy Create free account
hub / github.com/agentrpc/agentrpc / create_job

Method create_job

sdk-python/src/agentrpc/http_client.py:60–86  ·  view source on GitHub ↗
(
        self,
        cluster_id: str,
        function_name: Optional[str] = None,
        tool_name: Optional[str] = None,
        input_data: Dict[str, Any] = None,
    )

Source from the content-addressed store, hash-verified

58 raise AgentRPCError(f"Failed to list tools: {str(e)}")
59
60 def create_job(
61 self,
62 cluster_id: str,
63 function_name: Optional[str] = None,
64 tool_name: Optional[str] = None,
65 input_data: Dict[str, Any] = None,
66 ) -> Dict[str, Any]:
67 if not function_name and not tool_name:
68 raise AgentRPCError("Either function or tool must be provided")
69
70 payload = {"input": input_data or {}}
71
72 if function_name:
73 payload["function"] = function_name
74 if tool_name:
75 payload["tool"] = tool_name
76
77 query_params = {
78 "waitTime": "20",
79 }
80
81 try:
82 return self.post(
83 f"/clusters/{cluster_id}/jobs", payload, params=query_params
84 )
85 except Exception as e:
86 raise AgentRPCError(f"Failed to create job: {str(e)}")
87
88 def get_job(self, cluster_id: str, job_id: str) -> Dict[str, Any]:
89 try:

Callers 1

create_and_poll_jobMethod · 0.95

Calls 2

postMethod · 0.95
AgentRPCErrorClass · 0.70

Tested by

no test coverage detected