From f6794b76e2929ccb985adc28052504e8c4f7494a Mon Sep 17 00:00:00 2001 From: Hemang Sarkar Date: Thu, 30 Jan 2025 16:20:23 +0100 Subject: [PATCH] Update README.md --- README.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 97fa1d3..1d7ffd1 100644 --- a/README.md +++ b/README.md @@ -1 +1,33 @@ -# explorer-proxy \ No newline at end of file +# 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. + + +## OpenAI + +You can make requests to OpenAI while pushing traces to the Invariant Explorer. + +First get an API key by following the steps [here](https://explorer.invariantlabs.ai/docs/explorer/Explorer_API/1_client_setup/). + +Then you can use a custom `http_client` and `base_url` while setting up the OpenAI client object. + +A dataset with the given name will be created if it already doesn't exist. + +```python +from httpx import Client +from openai import OpenAI + +client = OpenAI( + http_client=Client( + headers={ + "Invariant-Authorization": "Bearer " + }, + ), + base_url="https://explorer.invariantlabs.ai/api/v1/proxy//openai", +) + +# Make API requests to OpenAI as usual. +``` + +## Anthropic +Coming Soon!