Skip to content

add gemini client - #12

Merged
alexzhang13 merged 4 commits into
alexzhang13:mainfrom
ainergiz:ainergiz/test-long-running-agents
Jan 5, 2026
Merged

alexzhang13 merged 4 commits into
alexzhang13:mainfrom
ainergiz:ainergiz/test-long-running-agents

Conversation

@ainergiz

@ainergiz ainergiz commented Jan 5, 2026 •

Copy link
Copy Markdown
Contributor

adds gemini.py in client options following official docs

made claude to write an ephemeral test to benchmark, worked like a charm with gemini-2.5-flash (3.0 models are preview and their gemini api is not the most reliable one)

one decision i wasn't sure about was whether to use openai compatibility or gemini's own recommended implementation. they disencourage openai compatibility and also has a new beta interactions api thing they are bringing. lemme know if you prefer openai compatibility

edit: realised test was missing, it's in place now in tests/clients. bit verbose opus style, can be trimmed

another question: checked this pr about anthropic client stream support. if the direction is using stream rather than create we can change it for gemini client from the start

ainergiz and others added 4 commits January 5, 2026 04:43
Adds support for Google Gemini models as a new backend option.

- Create GeminiClient in rlm/clients/gemini.py using official google-genai SDK
- Add "gemini" to ClientBackend type
- Register GeminiClient in get_client() factory
- Add google-genai>=1.56.0 dependency
- Default model: gemini-2.5-flash

Usage:
```python
rlm = RLM(
    backend="gemini",
    backend_kwargs={"api_key": "...", "model_name": "gemini-2.5-flash"},
    environment="local",
)
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Matches the pattern used in openai.py client.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 12 unit tests with mocked API calls
- 3 integration tests (skipped without GEMINI_API_KEY)
- Tests cover initialization, usage tracking, message preparation, role mapping

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@alexzhang13

Copy link
Copy Markdown
Owner

another question: checked this #6 about anthropic client stream support. if the direction is using stream rather than create we can change it for gemini client from the start

Likely won't worry about stream support for now, because it's doing multiple turns anyways. I like this as is.

@alexzhang13
alexzhang13 merged commit 231779e into alexzhang13:main Jan 5, 2026
3 checks passed
@alexzhang13

Copy link
Copy Markdown
Owner

Thanks, merged!

william-c-stanford referenced this pull request in akramlodi/rlm_self_harness Aug 9, 2026
…e review

Loader hardening: non-finite S6 values rejected at the caps gate (#1);
rejections keyed by unique directory names (#2); declared-id mismatch
caught at the text level before any candidate code runs (#3); gate
subprocess launch/decode failures return structured rejections (#11);
unhashable surface values rejected instead of raising (#12).
Ledger contract: non-finite band bounds render as null and all persisted
JSON is strict RFC-8259 (#4); rejection-only rounds persist an auditable
ledger with a null baseline (#5). Live smoke round regenerated with the
fixed serialization.

Claude-Session: https://claude.ai/code/session_01QfVmUyopDjKxK3b4nWxKWM
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.

2 participants