section9-lab opened a new pull request, #718:
URL: https://github.com/apache/flink-agents/pull/718

   [## What is the purpose of the change
   
   Add a dedicated Gemini chat model module 
(`integrations/chat-models/gemini/`) using the official `google-genai` Java SDK 
(v1.56.0), as proposed in #648.
   
   ### Key design decisions
   
   - **Native Gemini protocol**: system messages → `systemInstruction`, roles 
`user`/`model`, tool calls via `functionCall`/`functionResponse` parts with 
native `id` (no `tool_call_id`).
   - **Gemini 3 `thoughtSignature`**: captured from response parts and echoed 
back on multi-turn tool-use turns (required by gemini-3-pro-preview).
   - **Proxy support**: `base_url` parameter routes requests through a local 
proxy (e.g. CC Switch). When `api_key` is omitted but `base_url` is set, a 
placeholder key satisfies the SDK validation while the proxy injects the real 
credential.
   - **SDK**: `com.google.genai:google-genai:1.56.0` — supports both Gemini 
Developer API (API key) and Vertex AI (follow-up).
   
   ### Scope
   
   Java side: **text + function calling** only. Multimodal, streaming, full 
Vertex AI auth wiring, and the Python counterpart are tracked as follow-ups per 
#648.
   
   ### Files changed
   
   | File | Purpose |
   |------|---------|
   | `integrations/chat-models/gemini/pom.xml` | New module POM (parent: 
chat-models, dep: google-genai SDK) |
   | `GeminiChatModelConnection.java` | Connection class: `chat()`, 
message/tool/functionCall conversion, thoughtSignature round-trip |
   | `GeminiChatModelSetup.java` | Setup class: defaults (model, temperature, 
maxOutputTokens), `getParameters()` |
   | `GeminiChatModelConnectionTest.java` | 11 unit tests (constructor 
validation, role mapping, tool-call round-trip, signature preservation) |
   | `GeminiChatModelSetupTest.java` | 5 unit tests (defaults, custom params, 
validation) |
   | `integrations/chat-models/pom.xml` | Register `gemini` module |
   | `integrations/pom.xml` | Add `google.genai.version` property |
   
   ### Testing
   
   - **16 unit tests**, all pass, no API key required (CI-safe).
   - **End-to-end verified** against real `gemini-3-pro-preview` via local 
proxy: text generation ✅, function calling ✅, thoughtSignature echo ✅, 
multi-turn tool-result → final answer ✅.
   
   Closes #648


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to