Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gemini Adapter Rebuild —
google-genaiSDK v1.0+ MigrationSummary
Migrates the Gemini LLM adapter from the deprecated
google-generativeaiSDK to the moderngoogle-genai(v1.0+) SDK, achieving full protocol parity with the OpenAI and Anthropic adapters. Fixes the brokenLLMEngineGemini integration that was dropping system prompts, tools, and conversation history.Changes
Adapter (
gemini_adapter.py)GeminiAdapterfor thegenai.Clientpattern (client.models.generate_content/client.models.generate_content_stream) replacing legacygenai.configure()+GenerativeModel()usage_metadataGeminiChatSessionwith proper history management, including during streaming via_chat_stream_wrapperLLM Engine (
llm.py)_messages_to_gemini_contents()— converts OpenIntent messages to Gemini format (system →system_instruction, assistant →modelrole)_tools_to_gemini_format()— converts tool schemas to Gemini function declarations; returns[]for empty input_call_raw_providerand_stream_raw_provider_format_tools_for_providerfor GeminiDependencies (
pyproject.toml)google-generativeai>=0.4.0→google-genai>=1.0.0ingeminiandall-adaptersextrasgoogle.genaiDocs & Frontend
gemini-1.5-pro/gemini-2.0-flashtogemini-3-flashadapters.tsx,adapters.md,llm-adapters.md,llm-quickstart.mdTests
TestGeminiConversions(system extraction, no-system, multi-system, empty messages, tool format, empty tools)TestGeminiToolFormatConversion(protocol tool conversion,_format_tools_for_providerGemini path)Version
pyproject.toml,__init__.py, MCP serverpackage.json/index.ts,mkdocs.yml,home.html, changelogs, and frontendCI
ruff check .— passruff format --check .— passmypy openintent --ignore-missing-imports— passpytest -v— 105 passed