Catalog PyPI
Back to packageRELEASE DETAILS

0.0.8

PyPI

agentrpc

Python SDK for AgentRPC

Published19 Mar 2025
Direct dependencies8
Transitive dependenciesNot calculated

README

Version 0.0.8 documentation

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:

OptionTypeDefaultDescription
api_secretstrRequiredThe API secret key.
endpointstrhttps://api.agentrpc.comCustom API endpoint.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 9

Native requirements
8 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
requests
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
requests>=2.31.0runtime
openai
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
openai>=1.12.0runtime
build
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
build>=1.2.2.post1runtime
openai-agents
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
openai-agents>=0.0.4runtime
ruff
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
ruff>=0.3.0; extra == "dev"runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
pytest>=7.0.0; extra == "dev"runtime
python-dotenv
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
python-dotenv>=1.0.0; extra == "dev"runtime
build
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
build>=1.0.3; extra == "dev"runtime
twine
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
twine>=4.0.0; extra == "dev"runtime

Distribution files

2 collected
agentrpc-0.0.8-py3-none-any.whl

bdist_wheel · 6.28 KB · Python py3

Source file
agentrpc-0.0.8.tar.gz

sdist · 6.9 KB · Python source

Source file

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:13 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:9610646196e00a8ee5c533d7bffac19109cf3e4c3edb56e96bae092a0d3819bc

Other collected versions

View all collected versions →