Skip to content

Add support for Google AI Studio / Gemini API - #9

Closed
mlennie wants to merge 3 commits into
mainfrom
monty/gemini-support
Closed

Add support for Google AI Studio / Gemini API#9
mlennie wants to merge 3 commits into
mainfrom
monty/gemini-support

Conversation

@mlennie

@mlennie mlennie commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

… flavor

Phase 3.1 Complete: Python SDK Updates

Changes:
- Updated flavor_to_provider mapping: 'gemini_chat' now maps to 'gemini' instead of 'vertex'
- This enables customers to use Gemini API with simple API key authentication
- Separate from Vertex AI which uses GCP credentials

Files Modified:
- src/freeplay/resources/prompts.py: Changed mapping (1 line)
- tests/test_freeplay.py: Updated test data + added test_flavor_to_provider_mapping()
- CHANGELOG.md: Updated documentation example

Test Results:
- 144/144 tests passing (added 1 new test)
- Type check: PASSED (0 new errors)
- Linting: PASSED
- New test specifically validates gemini_chat → gemini mapping

Impact:
Customers can now use Gemini API templates with API keys:
  template = client.prompts.get(...)
  response = template.call(llm_api_key='gemini-api-key')

This works alongside existing Vertex AI support which continues to use
GCP authentication for customers who prefer that approach.
@macroscopeapp

macroscopeapp Bot commented Jan 16, 2026

Copy link
Copy Markdown

Add Gemini API provider support and update tests, docs, and REPL argument forwarding in recordings.py, tests/test_freeplay.py, README.md, and Makefile

Introduce provider="gemini" support across recordings and templates, adjust flavor-to-provider mapping expectations in tests, add a Gemini example script, and pass $(ARGS) through the make repl target.

📍Where to Start

Start with the CallInfo dataclass documentation and provider handling in recordings.py, then review flavor mapping in prompts.py and tests in tests/test_freeplay.py.


Macroscope summarized 14d91b0.

- Revert flavor mapping to 'vertex' for backward compatibility
- Add comprehensive documentation for Gemini vs Vertex AI
- Create gemini_api_example.py demonstrating both providers
- Update CHANGELOG with additive Gemini API support section
- Update README with provider comparison table
- Add docstring to CallInfo documenting supported providers
- Update Makefile to accept ARGS parameter for repl command

BREAKING CHANGE: None - both providers fully supported
@mlennie mlennie closed this Jan 16, 2026
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