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

Method __init__

sdk-python/src/agentrpc/client.py:8–30  ·  view source on GitHub ↗

Initialize the AgentRPC client. Args: api_secret: The API secret key. endpoint: Custom API endpoint. Defaults to 'https://api.agentrpc.com'.

(
        self,
        api_secret: str,
        endpoint: str = "https://api.agentrpc.com",
    )

Source from the content-addressed store, hash-verified

6 """AgentRPC client for connecting to AgentRPC API."""
7
8 def __init__(
9 self,
10 api_secret: str,
11 endpoint: str = "https://api.agentrpc.com",
12 ):
13 """Initialize the AgentRPC client.
14
15 Args:
16 api_secret: The API secret key.
17 endpoint: Custom API endpoint. Defaults to 'https://api.agentrpc.com'.
18 """
19
20 self.__api_secret = api_secret
21 self.__endpoint = endpoint
22 self.__http_client = HTTPClient(endpoint, api_secret)
23 self.openai = OpenAIIntegration(self)
24
25 parts = api_secret.split("_")
26 if len(parts) != 3 or parts[0] != "sk":
27 raise ValueError("Invalid API Secret.")
28 else:
29 _, cluster_id, rand = parts
30 self.cluster_id = cluster_id
31
32 def list_tools(self, params):
33 """List tools from the HTTP client."""

Callers

nothing calls this directly

Calls 2

HTTPClientClass · 0.85
OpenAIIntegrationClass · 0.85

Tested by

no test coverage detected