Update README.md

This commit is contained in:
Hemang Sarkar
2025-01-30 16:51:12 +01:00
committed by GitHub
parent 9888068850
commit 95ed80a8cd
+26 -23
View File
@@ -1,33 +1,36 @@
# Explorer Proxy
# **Explorer Proxy**
This is a lightweight Docker service which sits between the user and the LLM Provider (OpenAI, Anthropic, etc) and pushes the resultant agent traces to the [Invariant Explorer](https://explorer.invariantlabs.ai/) which lets you visualize and explore traces.
Explorer Proxy is a lightweight Docker service that acts as an intermediary between AI Agents and LLM providers (such as OpenAI and Anthropic). It captures and forwards agent interactions to the [Invariant Explorer](https://explorer.invariantlabs.ai/), enabling seamless visualization and exploration of traces.
## **Why Use Explorer Proxy?**
-**Intercept AI interactions** for better debugging and analysis.
-**Seamlessly forward API requests** to OpenAI, Anthropic, and other LLM providers.
-**Automatically store and organize traces** in Invariant Explorer.
## OpenAI
## **Getting Started**
To integrate Explorer Proxy with your AI agent, youll need to modify how your client interacts with LLM providers.
You can make requests to OpenAI while pushing traces to the Invariant Explorer.
### **🔹 OpenAI Integration**
1. **Get an API Key**
Follow the instructions [here](https://explorer.invariantlabs.ai/docs/explorer/Explorer_API/1_client_setup/) to obtain an API key.
First get an API key by following the steps [here](https://explorer.invariantlabs.ai/docs/explorer/Explorer_API/1_client_setup/).
2. **Modify OpenAI Client Setup**
Instead of connecting directly to OpenAI, configure your `OpenAI` client to use the proxy.
Then you can use a custom `http_client` and `base_url` while setting up the OpenAI client object.
```python
from httpx import Client
from openai import OpenAI
A dataset with the given name will be created if it already doesn't exist.
client = OpenAI(
http_client=Client(
headers={
"Invariant-Authorization": "Bearer <invariant-api-key>"
},
),
base_url="https://explorer.invariantlabs.ai/api/v1/proxy/<add-your-dataset-name-here>/openai",
)
```python
from httpx import Client
from openai import OpenAI
# Make API requests to OpenAI as usual.
client = OpenAI(
http_client=Client(
headers={
"Invariant-Authorization": "Bearer <invariant-api-key>"
},
),
base_url="https://explorer.invariantlabs.ai/api/v1/proxy/<add-your-dataset-name-here>/openai",
)
# Make API requests to OpenAI as usual.
```
## Anthropic
### **🔹 Anthropic Integration**
Coming Soon!