Skip to content

Commit 54bc162

Browse files
authored
feat: add Gemini model provider (#725)
1 parent 6ea8f72 commit 54bc162

File tree

7 files changed

+1278
-7
lines changed

7 files changed

+1278
-7
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Strands Agents is a simple yet powerful SDK that takes a model-driven approach t
3737
## Feature Overview
3838

3939
- **Lightweight & Flexible**: Simple agent loop that just works and is fully customizable
40-
- **Model Agnostic**: Support for Amazon Bedrock, Anthropic, LiteLLM, Llama, Ollama, OpenAI, Writer, and custom providers
40+
- **Model Agnostic**: Support for Amazon Bedrock, Anthropic, Gemini, LiteLLM, Llama, Ollama, OpenAI, Writer, and custom providers
4141
- **Advanced Capabilities**: Multi-agent systems, autonomous agents, and streaming support
4242
- **Built-in MCP**: Native support for Model Context Protocol (MCP) servers, enabling access to thousands of pre-built tools
4343

@@ -129,6 +129,8 @@ from strands import Agent
129129
from strands.models import BedrockModel
130130
from strands.models.ollama import OllamaModel
131131
from strands.models.llamaapi import LlamaAPIModel
132+
from strands.models.gemini import GeminiModel
133+
from strands.models.llamacpp import LlamaCppModel
132134

133135
# Bedrock
134136
bedrock_model = BedrockModel(
@@ -139,6 +141,15 @@ bedrock_model = BedrockModel(
139141
agent = Agent(model=bedrock_model)
140142
agent("Tell me about Agentic AI")
141143

144+
# Google Gemini
145+
gemini_model = GeminiModel(
146+
api_key="your_gemini_api_key",
147+
model_id="gemini-2.5-flash",
148+
params={"temperature": 0.7}
149+
)
150+
agent = Agent(model=gemini_model)
151+
agent("Tell me about Agentic AI")
152+
142153
# Ollama
143154
ollama_model = OllamaModel(
144155
host="http://localhost:11434",
@@ -158,6 +169,7 @@ response = agent("Tell me about Agentic AI")
158169
Built-in providers:
159170
- [Amazon Bedrock](https://strandsagents.com/latest/user-guide/concepts/model-providers/amazon-bedrock/)
160171
- [Anthropic](https://strandsagents.com/latest/user-guide/concepts/model-providers/anthropic/)
172+
- [Gemini](https://strandsagents.com/latest/user-guide/concepts/model-providers/gemini/)
161173
- [Cohere](https://strandsagents.com/latest/user-guide/concepts/model-providers/cohere/)
162174
- [LiteLLM](https://strandsagents.com/latest/user-guide/concepts/model-providers/litellm/)
163175
- [llama.cpp](https://strandsagents.com/latest/user-guide/concepts/model-providers/llamacpp/)

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ dependencies = [
4242

4343
[project.optional-dependencies]
4444
anthropic = ["anthropic>=0.21.0,<1.0.0"]
45+
gemini = ["google-genai>=1.32.0,<2.0.0"]
4546
litellm = ["litellm>=1.75.9,<2.0.0", "openai>=1.68.0,<1.108.0"]
4647
llamaapi = ["llama-api-client>=0.1.0,<1.0.0"]
4748
mistral = ["mistralai>=1.8.2"]
@@ -67,7 +68,7 @@ a2a = [
6768
"fastapi>=0.115.12,<1.0.0",
6869
"starlette>=0.46.2,<1.0.0",
6970
]
70-
all = ["strands-agents[a2a,anthropic,docs,litellm,llamaapi,mistral,ollama,openai,writer,sagemaker,otel]"]
71+
all = ["strands-agents[a2a,anthropic,docs,gemini,litellm,llamaapi,mistral,ollama,openai,writer,sagemaker,otel]"]
7172

7273
dev = [
7374
"commitizen>=4.4.0,<5.0.0",

0 commit comments

Comments
 (0)