AgentRPC Python SDK
A universal RPC layer for AI agents. Connect to any function, any language, any framework, in minutes.
⚠️ The AgentRPC Python SDK does not currently support registering tools.
Installation
pip install agentrpc
Registering Tools
Creating an AgentRPC Client
from agentrpc import AgentRPC
agentrpc = AgentRPC(
# Get your API secret from https://app.agentrpc.com
api_secret="YOUR_API_SECRET"
)
OpenAI Tools
AgentRPC provides integration with OpenAI's function calling capabilities, allowing you to expose your registered RPC functions as tools for OpenAI models to use.
Agents SDK
rpc.openai.agents.get_tools()
The get_tools() method returns your registered AgentRPC functions as OpenAI Agent tools.
# First register your functions with AgentRPC (Locally or on another machine)
# Attach the tools to the Agent
agent = Agent(name="AgentRPC Agent", tools=agentrpc.openai.agents.get_tools())
result = await Runner.run(
agent,
input="What is the weather in Melbourne?",
)
print(result.final_output)
Completions SDK
rpc.openai.completions.get_tools()
The get_tools() method returns your registered AgentRPC functions formatted as OpenAI tools, ready to be passed to OpenAI's API.
# First register your functions with AgentRPC (Locally or on another machine)
# Then get the tools formatted for OpenAI
tools = agentrpc.openai.get_tools()
# Pass these tools to OpenAI
chat_completion = openai.chat.completions.create(
model="gpt-4-1106-preview",
messages=messages,
tools=tools,
tool_choice="auto"
)
rpc.OpenAI.completions.execute_tool(tool_call)
The execute_tool() method executes an OpenAI tool call against your registered AgentRPC functions.
# Process tool calls from OpenAI's response
if chat_completion.choices[0].tool_calls:
for tool_call in response_message.tool_calls:
rpc.openai.execute_tool(tool_call)
API
AgentRPC(options?)
Creates a new AgentRPC client.
Options:
| Option | Type | Default | Description |
|---|---|---|---|
api_secret |
str | Required | The API secret key. |
endpoint |
str | https://api.agentrpc.com |
Custom API endpoint. |
Metadata
Release files for agentrpc 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agentrpc-0.0.8.tar.gz | 7.1 kB | Without provenance | Details for agentrpc-0.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentrpc-0.0.8-py3-none-any.whl | Python 3 | none | any | Details for agentrpc-0.0.8-py3-none-any.whl |
Total release size: 13.5 kB
Release files / agentrpc-0.0.8.tar.gz
| Download URL | agentrpc-0.0.8.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a37bdac464c04c076234a77c43bf31dbbacf6d26bb13c6132ff35d2cdc96195
|
|
BLAKE2b-256 checksum How to use checksums |
9be9662c4a28bf5a54f02ead78bc33020b9e3a7d68b60f61a8c1ff825ecd47f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / agentrpc-0.0.8-py3-none-any.whl
| Download URL | agentrpc-0.0.8-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
68d59eb77581483b7a39b522c19bab215817fa8cd182b7b19f53d8c20e35929a
|
|
BLAKE2b-256 checksum How to use checksums |
88e08d68a8a6675376faddc248e36c8cd3c9ecdf548d980191583557e63fd3f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for agentrpc 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.