Use Gemini without API key (#2805)

* google default auth and svc keyfile for Gemini

* [.Net] Release note for 0.0.14 (#2815)

* update release note

* update trigger

* [.Net] Update website for AutoGen.SemanticKernel and AutoGen.Ollama (#2814)
support vertex ai compute region

* [CAP] User supplied threads for agents (#2812)

* First pass:  message loop in main thread

* pypi version bump

* Fix readme

* Better example

* Fixed docs

* pre-commit fixes

* refactoring, minor fixes, update gemini demo ipynb

* add new deps again and reset line endings

* Docstring for the init function. Use private methods

* improve docstring

---------

Co-authored-by: Xiaoyun Zhang <bigmiao.zhang@gmail.com>
Co-authored-by: Rajan <rajan.chari@yahoo.com>
Co-authored-by: Zoltan Lux <z.lux@campus.tu-berlin.de>
This commit is contained in:
Zoltan Lux
2024-06-03 23:00:00 +02:00
committed by GitHub
parent 2000d47406
commit a959deeac6
4 changed files with 209 additions and 108 deletions

View File

@@ -33,11 +33,18 @@ def gemini_client():
return GeminiClient(api_key="fake_api_key")
# Test initialization and configuration
# Test compute location initialization and configuration
@pytest.mark.skipif(skip, reason="Google GenAI dependency is not installed")
def test_initialization():
def test_compute_location_initialization():
with pytest.raises(AssertionError):
GeminiClient() # Should raise an AssertionError due to missing API key
GeminiClient(
api_key="fake_api_key", location="us-west1"
) # Should raise an AssertionError due to specifying API key and compute location
@pytest.fixture
def gemini_google_auth_default_client():
return GeminiClient()
@pytest.mark.skipif(skip, reason="Google GenAI dependency is not installed")