mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
90a633967c
* Add Gemini and Vertex AI client support Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address Gemini PR review feedback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * removed sample run readme part --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
1.6 KiB
1.6 KiB
Gemini Package (agent-framework-gemini)
Integration with Google's Gemini Developer API and Vertex AI via the google-genai SDK.
Core Classes
RawGeminiChatClient- Lightweight chat client without any layers, for custom pipeline compositionGeminiChatClient- Full-featured chat client with function invocation, middleware, and telemetryGeminiChatOptions- Options TypedDict for Gemini-specific parametersGeminiSettings- Settings loaded from environment variablesGoogleGeminiSettings- SDK-standardGOOGLE_*settings loaded from environment variablesThinkingConfig- Configuration for extended thinking
Gemini-specific Options
thinking_config- Enable extended thinking viaThinkingConfigresponse_schema- Raw JSON schema dict for structured output (alternative toresponse_format)top_k- Top-K sampling parameter
Built-in Tool Factory Methods
get_web_search_tool()- Google Search grounding for up-to-date web answersget_code_interpreter_tool()- Sandboxed code executionget_maps_grounding_tool()- Google Maps grounding for location and mappingget_file_search_tool()- Retrieval from Gemini file search storesget_mcp_tool()- Model Context Protocol server integration
Usage
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")])])