> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentrpc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Python SDK

> Register tools with the Python SDK

The Python SDK provides a Pythonic way to consume tools with OpenAI's function calling capabilities.

## Installation

```bash theme={null}
pip install agentrpc
```

## Registering Tools

<Warning>The AgentRPC Python SDK does not currently support registering tools.</Warning>

## 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.

```python theme={null}
# 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.

```python theme={null}
# First register your functions with AgentRPC (Locally or on another machine)

# Then get the tools formatted for OpenAI
tools = agentrpc.openai.completions.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.

```python theme={null}
# Process tool calls from OpenAI's response
if chat_completion.choices[0].tool_calls:
  for tool_call in response_message.tool_calls:
    rpc.openai.completions.execute_tool(tool_call)
```

For more details, visit the [Python SDK GitHub repository](https://github.com/agentrpc/agentrpc/tree/main/sdk-python).
