Skip to content

v1.3.3

Latest

Choose a tag to compare

@vvlrff vvlrff released this 19 Nov 20:30
· 1 commit to main since this release
6d2dd8b

google-genai 3.x

ag2[gemini] capped google-genai at <3.0, so Gemini users could not install the current SDK. It now accepts google-genai>=1.68.0,<4, and a fresh pip install "ag2[gemini]" installs 3.x.

The generation API and types did not change in 3.0; both breaking changes concerntransport, and AG2 exposes each of them:

  • API version. On 3.x the Gemini Developer API defaults to v1 instead of v1beta. The -latest aliases and some -preview models exist only on v1beta. Anew api_version field opts back in, and is applied to both generation and the Files API:

    config = GeminiConfig(model="gemini-flash-latest", api_version="v1beta")

    VertexAIConfig.api_version accepts "v1" or "v1beta1"; Vertex keeps v1beta1 as its default on both SDK majors.

  • HTTP client. 3.x uses httpx2 by default. http_client now accepts an httpx2.AsyncClient as well as an httpx.AsyncClient; existing httpx clients keepworking on both majors.

Behaviour change. If your environment moves to google-genai 3.x, Gemini Developer API calls go to v1. A model that is available only on v1beta (a -latest alias, some previews) then fails; set api_version="v1beta" or pin google-genai<3.

Deprecation. google-genai 2.x still works in 1.3, but GeminiConfig / VertexAIConfig now emit a DeprecationWarning on create() and create_files_client(). AG2 1.4.0 will require google-genai>=3,<4.

Documentation

Gemini Live input transcription

With InputConfig(transcribe=True), a Gemini Live session on the Gemini API never sent a TranscriptionCompletedEvent for the user's speech: AG2 waited for a finished flag that the Gemini API does not send.

  • Gemini 3.x Live (including gemini-3.5-live-translate-preview) sends one final transcription per utterance, so each one is now completed as it arrives.
  • Earlier models send fragments. They are joined and completed as one event on finished, or else when the model's turn ends (generation_complete, interrupted or turn_complete). Where finished does arrive, the event now holds the whole utterance instead of only the last fragment.

TranscriptionChunkEvents are sent per message, as before.

Behaviour change. Gemini Live sessions on the Gemini API now emit TranscriptionCompletedEvent for the user's speech. On a 3.x model it follows a chunk withthe same text.


Fixes

  • OpenAI-compatible reasoning: OpenAICompletionsConfig read reasoning on complete responses and reasoning_content when streaming, so reasoning was dropped for vLLM, OpenRouter and Ollama-compatible endpoints when streaming, and for DeepSeek and SGLang otherwise. Both fields are now read in both modes, and ModelReasoning is emitted once even when a provider fills both.
  • A2UI: A single-line fenced payload followed by a closing fence on its own line (```json [...]\n```) was parsed as empty, so the UI was silently notrendered. Only the fence markers are stripped now, which also keeps payloads thatstart on the fence line.

Documentation and project

  • The whole ag2 package is now checked with strict mypy, with no per-file allow-list, so new modules are checked as soon as they are added. Most test directoriesare type-checked under a relaxed profile.
  • CI runs the test suite against google-genai 2.x until support for it is removed.

What's Changed

  • chore(deps): bump github/codeql-action/upload-sarif from 4.39.1 to 4.39.3 in the github-actions group by @dependabot[bot] in #3678
  • fix(a2ui): keep single-line fenced JSON payload with a standalone closing fenceby @lkuko in #3674
  • fix(live): complete Gemini Live input transcription with the whole utterance by @Assertive-xxh in #3686
  • feat(gemini): support google-genai 3.x and deprecate 2.x by @vvlrff in #3683
  • fix(types): check ag2/network with strict mypy by @vvlrff in #3682
  • chore(types): check all of ag2 with strict mypy by @vvlrff in #3688
  • chore(types): check root tests with mypy under a relaxed test profile by @vvlrff in #3690
  • chore(types): check ag_ui, events, mcp_ui, observer and policies tests with mypy by @vvlrff in #3691
  • fix(live): complete Gemini 3.5 Live translate input transcriptions as they arrive by @vvlrff in #3687
  • fix(openai): read both reasoning_content and reasoning in completions by @yibol9768-alt in #3684
  • chore(types): check response and eval tests with mypy by @vvlrff in #3692
  • chore: bump version to 1.3.3 by @vvlrff in #3693

New Contributors

Full Changelog: v1.3.2...v1.3.3