Skip to content

Commit 74a7965

Browse files
Merge branch 'main' of github.com:invariantlabs-ai/docs
2 parents d4bbe43 + 5abc6aa commit 74a7965

File tree

4 files changed

+73
-7
lines changed

4 files changed

+73
-7
lines changed

docs/gateway/llm-provider-integrations/anthropic.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ This code will push your trace to the [Invariant Explorer](https://explorer.inva
5151

5252
<div class='tiles'>
5353

54-
<a href="../anthropic" class='tile'>
54+
<a href="../openai" class='tile'>
5555
<span class='tile-title'>OpenAI Integration →</span>
5656
<span class='tile-description'>Seamlessly connect to OpenAI APIs through the Invariant Gateway.</span>
5757
</a>
5858

59-
<a href="../../agent-integrations/microsoft-autogen" class='tile'>
60-
<span class='tile-title'>Microsoft AutoGen Integration →</span>
61-
<span class='tile-description'>Enhance and debug your Microsoft AutoGen agents effortlessly using the Gateway.</span>
59+
<a href="../gemini" class='tile'>
60+
<span class='tile-title'>Gemini Integration →</span>
61+
<span class='tile-description'>Leverage the Invariant Gateway for smooth Gemini API interactions.</span>
6262
</a>
6363

6464
<a href="../../agent-integrations/openai-swarm" class='tile'>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Gemini Integration
2+
3+
With just a few changes in your ```Gemini``` client setup, you can start using the Invariant Gateway to visualize and debug your traces.
4+
5+
6+
## Getting the Invariant API Key
7+
8+
Visit the [Explorer Documentation](https://explorer.invariantlabs.ai/docs/explorer) to learn how to obtain your own API key.
9+
10+
## Setup Gemini API Key
11+
12+
```bash
13+
export GEMINI_API_KEY={your-gemini-api-key}
14+
```
15+
16+
## Code
17+
18+
```python
19+
import os
20+
21+
from google import genai
22+
23+
client = genai.Client(
24+
api_key=os.environ["GEMINI_API_KEY"],
25+
http_options={
26+
"base_url": "https://explorer.invariantlabs.ai/api/v1/gateway/{add-your-dataset-name-here}/gemini",
27+
"headers": {
28+
"Invariant-Authorization": "Bearer your-invariant-api-key"
29+
},
30+
},
31+
)
32+
33+
result = client.models.generate_content(
34+
model="gemini-2.0-flash",
35+
contents="Explain how SSL works",
36+
config={
37+
"maxOutputTokens": 200
38+
},
39+
)
40+
41+
print("result: ", result)
42+
```
43+
44+
This would push your trace to the [Invariant Explorer](https://explorer.invariantlabs.ai/) where it will be available under the dataset used above.
45+
46+
## Explore other integrations
47+
48+
<div class='tiles'>
49+
50+
<a href="../openai" class='tile'>
51+
<span class='tile-title'>OpenAI Integration →</span>
52+
<span class='tile-description'>Seamlessly connect to OpenAI APIs through the Invariant Gateway.</span>
53+
</a>
54+
55+
<a href="../anthropic" class='tile'>
56+
<span class='tile-title'>Anthropic Integration →</span>
57+
<span class='tile-description'>Leverage the Invariant Gateway for smooth Anthropic API interactions.</span>
58+
</a>
59+
60+
<a href="../../agent-integrations/openai-swarm" class='tile'>
61+
<span class='tile-title'>OpenAI Swarm Integration →</span>
62+
<span class='tile-description'>Enhance and debug your OpenAI Swarm agents effortlessly using the Gateway.</span>
63+
</a>
64+
65+
</div>

docs/gateway/llm-provider-integrations/openai.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ This code will push your trace to the [Invariant Explorer](https://explorer.inva
5656
<span class='tile-description'>Leverage the Invariant Gateway for smooth Anthropic API interactions.</span>
5757
</a>
5858

59-
<a href="../../agent-integrations/microsoft-autogen" class='tile'>
60-
<span class='tile-title'>Microsoft AutoGen Integration →</span>
61-
<span class='tile-description'>Enhance and debug your Microsoft AutoGen agents effortlessly using the Gateway.</span>
59+
<a href="../gemini" class='tile'>
60+
<span class='tile-title'>Gemini Integration →</span>
61+
<span class='tile-description'>Leverage the Invariant Gateway for smooth Gemini API interactions.</span>
6262
</a>
6363

6464
<a href="../../agent-integrations/openai-swarm" class='tile'>

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ nav:
7676
- LLM Integrations:
7777
- OpenAI: gateway/llm-provider-integrations/openai.md
7878
- Anthropic: gateway/llm-provider-integrations/anthropic.md
79+
- Gemini: gateway/llm-provider-integrations/gemini.md
7980
- Agent Integrations:
8081
- Microsoft AutoGen: gateway/agent-integrations/microsoft-autogen.md
8182
- OpenAI Agents SDK: gateway/agent-integrations/openai-agents-sdk.md

0 commit comments

Comments
 (0)