chore(deps)!: migrate from @google/generative-ai to @google/genai #6

Merged
jleibl merged 1 commits from chore/deps-google-genai-migration into main 2026-05-21 10:56:05 +00:00
Owner

The @google/generative-ai SDK has been deprecated by Google. This switches
to the successor @google/genai package and rewrites the Gemini provider
against the new stateless models/chats API.

BREAKING CHANGE: GeminiConfig.safetySettings now uses the SafetySetting
type from @google/genai. Consumers passing this field must update their
import from '@google/generative-ai' to '@google/genai'. The shape of the
type is similar but not identical.

Notable simplifications enabled by the new SDK:

  • No per-model client caching: generateContent specifies model per-call
  • Single code path for both single- and multi-turn (full contents array
    is passed to generateContent directly; no more startChat branching)
  • Stream chunks expose .text as a property (was .text() method)
  • Stream iteration is direct on the response (no .stream sub-property)

Default model bumped from gemini-1.5-flash to gemini-2.5-flash.

The @google/generative-ai SDK has been deprecated by Google. This switches to the successor @google/genai package and rewrites the Gemini provider against the new stateless models/chats API. BREAKING CHANGE: GeminiConfig.safetySettings now uses the SafetySetting type from @google/genai. Consumers passing this field must update their import from '@google/generative-ai' to '@google/genai'. The shape of the type is similar but not identical. Notable simplifications enabled by the new SDK: - No per-model client caching: generateContent specifies model per-call - Single code path for both single- and multi-turn (full contents array is passed to generateContent directly; no more startChat branching) - Stream chunks expose .text as a property (was .text() method) - Stream iteration is direct on the response (no .stream sub-property) Default model bumped from gemini-1.5-flash to gemini-2.5-flash.
jleibl added 1 commit 2026-05-21 10:55:39 +00:00
The @google/generative-ai SDK has been deprecated by Google. This switches
to the successor @google/genai package and rewrites the Gemini provider
against the new stateless models/chats API.

BREAKING CHANGE: GeminiConfig.safetySettings now uses the SafetySetting
type from @google/genai. Consumers passing this field must update their
import from '@google/generative-ai' to '@google/genai'. The shape of the
type is similar but not identical.

Notable simplifications enabled by the new SDK:
- No per-model client caching: generateContent specifies model per-call
- Single code path for both single- and multi-turn (full contents array
  is passed to generateContent directly; no more startChat branching)
- Stream chunks expose .text as a property (was .text() method)
- Stream iteration is direct on the response (no .stream sub-property)

Default model bumped from gemini-1.5-flash to gemini-2.5-flash.
jleibl merged commit fbe66623a1 into main 2026-05-21 10:56:05 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jleibl/simple-ai-provider#6