The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
docs(gemini.md): show how to call google search via litellm
Krrish Dholakiaa3ea079583dd
diff --git a/docs/my-website/docs/providers/gemini.md b/docs/my-website/docs/providers/gemini.mdindex 42783286f12..db63d33d8d6 100644--- a/docs/my-website/docs/providers/gemini.md+++ b/docs/my-website/docs/providers/gemini.md@@ -438,6 +438,179 @@ assert isinstance(```+### Google Search Tool++<Tabs>+<TabItem value="sdk" label="SDK">++```python+from litellm import completion+import os++os.environ["GEMINI_API_KEY"] = ".."++tools = [{"googleSearch": {}}] # 👈 ADD GOOGLE SEARCH++response = completion(+ model="gemini/gemini-2.0-flash",+ messages=[{"role": "user", "content": "What is the weather in San Francisco?"}],+ tools=tools,+)++print(response)+```++</TabItem>+<TabItem value="proxy" label="PROXY">++1. Setup config.yaml+```yaml+model_list:+ - model_name: gemini-2.0-flash+ litellm_params:+ model: gemini/gemini-2.0-flash+ api_key: os.environ/GEMINI_API_KEY+```++2. Start Proxy+```bash+$ litellm --config /path/to/config.yaml+```++3. Make Request!+```bash+curl -X POST 'http://0.0.0.0:4000/chat/completions' \+-H 'Content-Type: application/json' \+-H 'Authorization: Bearer sk-1234' \+-d '{+ "model": "gemini-2.0-flash",+ "messages": [{"role": "user", "content": "What is the weather in San Francisco?"}],+ "tools": [{"googleSearch": {}}]+}+'+```++</TabItem>+</Tabs>++### Google Search Retrieval+++<Tabs>+<TabItem value="sdk" label="SDK">++```python+from litellm import completion+import os++os.environ["GEMINI_API_KEY"] = ".."++tools = [{"googleSearchRetrieval": {}}] # 👈 ADD GOOGLE SEARCH++response = completion(+ model="gemini/gemini-2.0-flash",+ messages=[{"role": "user", "content": "What is the weather in San Francisco?"}],+ tools=tools,+)++print(response)+```++</TabItem>+<TabItem value="proxy" label="PROXY">++1. Setup config.yaml+```yaml+model_list:+ - model_name: gemini-2.0-flash+ litellm_params:+ model: gemini/gemini-2.0-flash+ api_key: os.environ/GEMINI_API_KEY+```++2. Start Proxy+```bash+$ litellm --config /path/to/config.yaml+```++3. Make Request!+```bash+curl -X POST 'http://0.0.0.0:4000/chat/completions' \+-H 'Content-Type: application/json' \+-H 'Authorization: Bearer sk-1234' \+-d '{+ "model": "gemini-2.0-flash",+ "messages": [{"role": "user", "content": "What is the weather in San Francisco?"}],+ "tools": [{"googleSearchRetrieval": {}}]+}+'+```++</TabItem>+</Tabs>+++### Code Execution Tool+++<Tabs>+<TabItem value="sdk" label="SDK">++```python+from litellm import completion+import os++os.environ["GEMINI_API_KEY"] = ".."++tools = [{"codeExecution": {}}] # 👈 ADD GOOGLE SEARCH++response = completion(+ model="gemini/gemini-2.0-flash",+ messages=[{"role": "user", "content": "What is the weather in San Francisco?"}],+ tools=tools,+)++print(response)+```++</TabItem>+<TabItem value="proxy" label="PROXY">++1. Setup config.yaml+```yaml+model_list:+ - model_name: gemini-2.0-flash+ litellm_params:+ model: gemini/gemini-2.0-flash+ api_key: os.environ/GEMINI_API_KEY+```++2. Start Proxy+```bash+$ litellm --config /path/to/config.yaml+```++3. Make Request!+```bash+curl -X POST 'http://0.0.0.0:4000/chat/completions' \+-H 'Content-Type: application/json' \+-H 'Authorization: Bearer sk-1234' \+-d '{+ "model": "gemini-2.0-flash",+ "messages": [{"role": "user", "content": "What is the weather in San Francisco?"}],+ "tools": [{"codeExecution": {}}]+}+'+```++</TabItem>+</Tabs>++++++## JSON Mode<Tabs>