Skip to content

fix(guardian): migrate to google-genai SDK + configurable model#84

Merged
zaebee merged 3 commits into
mainfrom
fix/guardian-google-genai
Jun 8, 2026
Merged

fix(guardian): migrate to google-genai SDK + configurable model#84
zaebee merged 3 commits into
mainfrom
fix/guardian-google-genai

Conversation

@zaebee

@zaebee zaebee commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Problem

google.generativeai is fully deprecated and end-of-life:

All support for the google.generativeai package has ended.

Changes

  • google-generativeaigoogle-genai in [dependency-groups] and gemini.py
  • New API: genai.Client(api_key=...).aio.models.generate_content(...) with GenerateContentConfig(system_instruction=...)
  • GUARDIAN_MODEL env var — override default model without touching code
    Set via: repo Settings → Variables → Actions → GUARDIAN_MODEL
    Default: gemini-2.0-flash

Test plan

Closes the FutureWarning crash introduced after PR #83.

zaebee and others added 2 commits June 8, 2026 22:12
…genai

google.generativeai is end-of-life; all support has ended.
Switching to google-genai (google.genai.Client) with async support via
client.aio.models.generate_content and GenerateContentConfig for
system_instruction.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- GUARDIAN_MODEL GitHub Actions variable overrides the default model
- Falls back to gemini-2.0-flash when not set
- Set via Settings → Variables → Actions (not a secret — not sensitive)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

SonarQube S2083: resolve and check is_relative_to(cwd) before writing
to prevent path traversal via user-controlled --output argument.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

@zaebee zaebee merged commit da633df into main Jun 8, 2026
3 checks passed
@zaebee zaebee deleted the fix/guardian-google-genai branch June 8, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant