Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
0e35f04
Add agent-framework-gemini package
holtvogt Mar 23, 2026
33f437f
Add AGENTS.md documentation
holtvogt Mar 23, 2026
38d3d28
Add LICENSE file
holtvogt Mar 23, 2026
29ed60c
Add README.md for agent-framework-gemini package
holtvogt Mar 23, 2026
0dace12
Add Google Gemini API keys to .env.example
holtvogt Mar 23, 2026
06de5cf
Add Google Gemini chat client implementation
holtvogt Mar 23, 2026
24fdbeb
Add tests for GeminiChatClient
holtvogt Mar 23, 2026
dbc1709
Add Google Gemini agent examples
holtvogt Mar 23, 2026
41e7f6e
Merge branch 'main' into feat/add-gemini-client
holtvogt Mar 23, 2026
85a86a1
Fix client inheritence order
holtvogt Mar 23, 2026
db6521b
Update Gemini agent examples
holtvogt Mar 23, 2026
54af10b
Update documentation
holtvogt Mar 23, 2026
cf4a6fb
Update AGENTS.md
holtvogt Mar 23, 2026
0b0afd1
Add tests for JSON string handling in GeminiChatClient
holtvogt Mar 23, 2026
8964929
Add final response assembly test in GeminiChatClient
holtvogt Mar 23, 2026
533aa7c
Add tests for handling empty candidates in GeminiChatClient
holtvogt Mar 23, 2026
308c474
Improve Pydantic response handling in GeminiChatClient
holtvogt Mar 23, 2026
80580fc
Add tests for function result resolution and callable tool normalization
holtvogt Mar 23, 2026
aeda903
Add test for function result resolution when call_id is generated
holtvogt Mar 23, 2026
ff52460
Refactor GeminiChatClient to correct inheritance order
holtvogt Mar 23, 2026
c7529f9
Enhance documentation and clarify Gemini-specific fields
holtvogt Mar 23, 2026
5a839e6
Update ThinkingConfig with new attributes and type
holtvogt Mar 23, 2026
6a86850
Add tests for GoogleSearch and GoogleMaps configs
holtvogt Mar 23, 2026
093e211
Suppress valid-type mypy error on GeminiChatOptionsT
holtvogt Mar 23, 2026
49d99ea
Move service_url method near overrides
holtvogt Mar 23, 2026
2add366
Order _prepare_config kwargs by base then Gemini-specific
holtvogt Mar 23, 2026
03ee022
Use FunctionCallingConfigMode for clarity and type safety
holtvogt Mar 23, 2026
aab2167
Merge branch 'main' into feat/add-gemini-client
holtvogt Mar 23, 2026
b9fa07d
Fix code_execution doc
holtvogt Mar 23, 2026
cb8d1e7
Add agent-framework-gemini to project dependencies
holtvogt Mar 24, 2026
5a2f268
Merge branch 'main' into feat/add-gemini-client
holtvogt Mar 24, 2026
3bddddf
Remove package from core dependencies
holtvogt Mar 24, 2026
eba6ded
Move integration tests into one file
holtvogt Mar 24, 2026
901fc44
Remove __init__.py file from gemini tests directory
holtvogt Mar 24, 2026
e81e6f4
Introduce RawGeminiChatClient as lightweight chat client
holtvogt Mar 24, 2026
6f29d45
Updated variable names from `model_id` to `model`
holtvogt Mar 24, 2026
60a4ade
Update AGENTS.md
holtvogt Mar 24, 2026
c3259ea
Merge remote-tracking branch 'origin/main' into feat/add-gemini-client
holtvogt Mar 25, 2026
c6a3df9
Merge branch 'main' into feat/add-gemini-client
holtvogt Mar 26, 2026
dd39952
Merge branch 'main' into feat/add-gemini-client
holtvogt Mar 30, 2026
3da213f
Merge branch 'main' into feat/add-gemini-client
holtvogt Apr 9, 2026
27f3f21
Merge branch 'main' into feat/add-gemini-client
holtvogt Apr 10, 2026
fb931c0
Update Gemini package to alpha status
holtvogt Apr 10, 2026
fdc816d
Fix docstrings in Gemini tests
holtvogt Apr 10, 2026
374bf60
Change 'model_id' to 'model' in response handling
holtvogt Apr 10, 2026
718f561
Fix model property change in response handling
holtvogt Apr 10, 2026
9f5c508
Add built-in tool factory methods to Gemini client
holtvogt Apr 10, 2026
b4056d8
Surface code execution parts
holtvogt Apr 10, 2026
b3a0a30
Update Gemini client documentation
holtvogt Apr 10, 2026
57df672
Merge branch 'main' into feat/add-gemini-client
holtvogt Apr 10, 2026
313a001
Unify Gemini model name
holtvogt Apr 10, 2026
29855dd
Update Agent Framework core version
holtvogt Apr 10, 2026
149b463
Add Python 3.14 in classifiers
holtvogt Apr 10, 2026
e7e4183
Replace kwargs with parameters in tool factories
holtvogt Apr 10, 2026
889a846
Refactor chat options handling in Gemini client
holtvogt Apr 10, 2026
fa18e0e
Add tests for handling unknown and consumed keys
holtvogt Apr 10, 2026
d29c077
Update Gemini documentation
holtvogt Apr 10, 2026
2c44e29
Change build system to flit
holtvogt Apr 14, 2026
e7d5618
Merge branch 'main' into feat/add-gemini-client
holtvogt Apr 14, 2026
b05b627
Fix build system in pyproject.toml
holtvogt Apr 14, 2026
8fac9e4
Fix type checking for generate_content_stream
holtvogt Apr 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions python/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ COPILOTSTUDIOAGENT__AGENTAPPID=""
# Anthropic
ANTHROPIC_API_KEY=""
ANTHROPIC_MODEL=""
# Google Gemini
GEMINI_API_KEY=""
GEMINI_MODEL=""
# Ollama
OLLAMA_ENDPOINT=""
OLLAMA_MODEL=""
Expand Down
1 change: 1 addition & 0 deletions python/PACKAGE_STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Status is grouped into these buckets:
| `agent-framework-durabletask` | `python/packages/durabletask` | `beta` |
| `agent-framework-foundry` | `python/packages/foundry` | `released` |
| `agent-framework-foundry-local` | `python/packages/foundry_local` | `beta` |
| `agent-framework-gemini` | `python/packages/gemini` | `alpha` |
| `agent-framework-github-copilot` | `python/packages/github_copilot` | `beta` |
| `agent-framework-lab` | `python/packages/lab` | `beta` |
| `agent-framework-mem0` | `python/packages/mem0` | `beta` |
Expand Down
6 changes: 3 additions & 3 deletions python/packages/core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@ all = [
"mcp>=1.24.0,<2",
"agent-framework-a2a",
"agent-framework-ag-ui",
"agent-framework-anthropic",
"agent-framework-azure-ai-search",
"agent-framework-azure-cosmos",
"agent-framework-anthropic",
"agent-framework-openai",
"agent-framework-claude",
"agent-framework-azurefunctions",
"agent-framework-bedrock",
"agent-framework-chatkit",
"agent-framework-claude",
"agent-framework-copilotstudio",
"agent-framework-declarative",
"agent-framework-devui",
Expand All @@ -52,6 +51,7 @@ all = [
"agent-framework-lab",
"agent-framework-mem0",
"agent-framework-ollama",
"agent-framework-openai",
"agent-framework-orchestrations",
"agent-framework-purview",
"agent-framework-redis",
Expand Down
35 changes: 35 additions & 0 deletions python/packages/gemini/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Gemini Package (agent-framework-gemini)

Integration with Google's Gemini API via the `google-genai` SDK.

## Core Classes

- **`RawGeminiChatClient`** - Lightweight chat client without any layers, for custom pipeline composition
- **`GeminiChatClient`** - Full-featured chat client with function invocation, middleware, and telemetry
- **`GeminiChatOptions`** - Options TypedDict for Gemini-specific parameters
- **`GeminiSettings`** - Settings loaded from environment variables
- **`ThinkingConfig`** - Configuration for extended thinking

## Gemini-specific Options

- **`thinking_config`** - Enable extended thinking via `ThinkingConfig`
- **`response_schema`** - Raw JSON schema dict for structured output (alternative to `response_format`)
- **`top_k`** - Top-K sampling parameter

## Built-in Tool Factory Methods

- **`get_web_search_tool()`** - Google Search grounding for up-to-date web answers
- **`get_code_interpreter_tool()`** - Sandboxed code execution
- **`get_maps_grounding_tool()`** - Google Maps grounding for location and mapping
- **`get_file_search_tool()`** - Retrieval from Gemini file search stores
- **`get_mcp_tool()`** - Model Context Protocol server integration

## Usage

```python
from agent_framework import Content, Message
from agent_framework_gemini import GeminiChatClient

client = GeminiChatClient(model="gemini-2.5-flash")
response = await client.get_response([Message(role="user", contents=[Content.from_text("Hello")])])
```
21 changes: 21 additions & 0 deletions python/packages/gemini/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Microsoft Corporation.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
30 changes: 30 additions & 0 deletions python/packages/gemini/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Get Started with Microsoft Agent Framework Gemini

Install the provider package:

```bash
pip install agent-framework-gemini --pre
```

## Gemini Integration

The Gemini integration enables Microsoft Agent Framework applications to call Google Gemini models with familiar chat abstractions, including streaming, tool/function calling, and structured output.

## Authentication

Obtain an API key from [Google AI Studio](https://aistudio.google.com/apikey) and set it via environment variable:

```bash
export GEMINI_API_KEY="your-api-key"
export GEMINI_MODEL="gemini-2.5-flash"
```

## Examples

See the [Google Gemini samples](samples/) for runnable end-to-end scripts covering:

- Basic agent with tool calling and streaming
- Extended thinking with `ThinkingConfig`
- Google Search grounding
- Google Maps grounding
- Built-in code execution
19 changes: 19 additions & 0 deletions python/packages/gemini/agent_framework_gemini/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) Microsoft. All rights reserved.

import importlib.metadata

from ._chat_client import GeminiChatClient, GeminiChatOptions, GeminiSettings, RawGeminiChatClient, ThinkingConfig

try:
__version__ = importlib.metadata.version(__name__)
except importlib.metadata.PackageNotFoundError:
__version__ = "0.0.0"

__all__ = [
"GeminiChatClient",
"GeminiChatOptions",
"GeminiSettings",
"RawGeminiChatClient",
"ThinkingConfig",
"__version__",
]
Loading
Loading