Skip to content

Commit 0d7eaa7

Browse files
author
Jeyaram Jeyaraj
committed
fix: Address pre-commit hooks failures
- Export GoogleAISettings in __init__.py for public API - Update README.md example to use SecretStr for type safety - Comment out future code example to avoid pyright validation errors - Auto-format code with ruff Addresses CI feedback from PR reviewer.
1 parent d1cdc62 commit 0d7eaa7

File tree

4 files changed

+22
-23
lines changed

4 files changed

+22
-23
lines changed

python/packages/google/README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ from agent_framework_google import GoogleAISettings
4040

4141
settings = GoogleAISettings()
4242

43-
# Or pass parameters directly
43+
# Or pass parameters directly (pass SecretStr for type safety)
44+
from pydantic import SecretStr
45+
4446
settings = GoogleAISettings(
45-
api_key="your_api_key",
47+
api_key=SecretStr("your_api_key"),
4648
chat_model_id="gemini-1.5-pro"
4749
)
4850
```
@@ -52,20 +54,20 @@ settings = GoogleAISettings(
5254
Once the chat client is released, usage will look like this:
5355

5456
```python
55-
from agent_framework.google import GoogleAIChatClient
56-
57-
# Configure via environment variables
58-
# GOOGLE_AI_API_KEY=your_api_key
59-
# GOOGLE_AI_CHAT_MODEL_ID=gemini-1.5-pro
60-
61-
client = GoogleAIChatClient()
62-
agent = client.create_agent(
63-
name="Assistant",
64-
instructions="You are a helpful assistant"
65-
)
66-
67-
response = await agent.run("Hello!")
68-
print(response.text)
57+
# from agent_framework.google import GoogleAIChatClient
58+
#
59+
# # Configure via environment variables
60+
# # GOOGLE_AI_API_KEY=your_api_key
61+
# # GOOGLE_AI_CHAT_MODEL_ID=gemini-1.5-pro
62+
#
63+
# client = GoogleAIChatClient()
64+
# agent = client.create_agent(
65+
# name="Assistant",
66+
# instructions="You are a helpful assistant"
67+
# )
68+
#
69+
# response = await agent.run("Hello!")
70+
# print(response.text)
6971
```
7072

7173
## Configuration

python/packages/google/agent_framework_google/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
import importlib.metadata
44

5+
from ._chat_client import GoogleAISettings
6+
57
# NOTE: Client class will be imported here in a future PR
6-
# from ._chat_client import GoogleAIChatClient
78

89
try:
910
__version__ = importlib.metadata.version(__name__)
1011
except importlib.metadata.PackageNotFoundError:
1112
__version__ = "0.0.0" # Fallback for development mode
1213

1314
__all__ = [
14-
# "GoogleAIChatClient", # Will be added in a future PR
15+
"GoogleAISettings",
1516
"__version__",
1617
]

python/packages/google/agent_framework_google/_chat_client.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ class GoogleAISettings(AFBaseSettings):
3232
settings = GoogleAISettings()
3333
3434
# Or passing parameters directly
35-
settings = GoogleAISettings(
36-
api_key="your_api_key",
37-
chat_model_id="gemini-1.5-pro"
38-
)
35+
settings = GoogleAISettings(api_key="your_api_key", chat_model_id="gemini-1.5-pro")
3936
4037
# Or loading from a .env file
4138
settings = GoogleAISettings(env_file_path="path/to/.env")

python/packages/google/tests/test_settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
from agent_framework_google._chat_client import GoogleAISettings
55

6-
76
# region GoogleAISettings Tests
87

98

0 commit comments

Comments
 (0)