hyperforge-google 1.0.0.post35__tar.gz → 1.0.0.post45__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (15) hide show
  1. {hyperforge_google-1.0.0.post35 → hyperforge_google-1.0.0.post45}/PKG-INFO +1 -1
  2. {hyperforge_google-1.0.0.post35 → hyperforge_google-1.0.0.post45}/pyproject.toml +1 -1
  3. {hyperforge_google-1.0.0.post35 → hyperforge_google-1.0.0.post45}/src/hyperforge_google/driver.py +12 -5
  4. {hyperforge_google-1.0.0.post35 → hyperforge_google-1.0.0.post45}/src/hyperforge_google.egg-info/PKG-INFO +1 -1
  5. {hyperforge_google-1.0.0.post35 → hyperforge_google-1.0.0.post45}/README.md +0 -0
  6. {hyperforge_google-1.0.0.post35 → hyperforge_google-1.0.0.post45}/setup.cfg +0 -0
  7. {hyperforge_google-1.0.0.post35 → hyperforge_google-1.0.0.post45}/src/hyperforge_google/__init__.py +0 -0
  8. {hyperforge_google-1.0.0.post35 → hyperforge_google-1.0.0.post45}/src/hyperforge_google/agent.py +0 -0
  9. {hyperforge_google-1.0.0.post35 → hyperforge_google-1.0.0.post45}/src/hyperforge_google/config.py +0 -0
  10. {hyperforge_google-1.0.0.post35 → hyperforge_google-1.0.0.post45}/src/hyperforge_google/py.typed +0 -0
  11. {hyperforge_google-1.0.0.post35 → hyperforge_google-1.0.0.post45}/src/hyperforge_google.egg-info/SOURCES.txt +0 -0
  12. {hyperforge_google-1.0.0.post35 → hyperforge_google-1.0.0.post45}/src/hyperforge_google.egg-info/dependency_links.txt +0 -0
  13. {hyperforge_google-1.0.0.post35 → hyperforge_google-1.0.0.post45}/src/hyperforge_google.egg-info/requires.txt +0 -0
  14. {hyperforge_google-1.0.0.post35 → hyperforge_google-1.0.0.post45}/src/hyperforge_google.egg-info/top_level.txt +0 -0
  15. {hyperforge_google-1.0.0.post35 → hyperforge_google-1.0.0.post45}/tests/test_google.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyperforge_google
3
- Version: 1.0.0.post35
3
+ Version: 1.0.0.post45
4
4
  Summary: Google Search Hyperforge agent
5
5
  Author-email: Nuclia <nucliadb@nuclia.com>
6
6
  License-Expression: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hyperforge_google"
7
- version = "1.0.0.post35"
7
+ version = "1.0.0.post45"
8
8
  license = "Apache-2.0"
9
9
  description = "Google Search Hyperforge agent"
10
10
  authors = [{ name = "Nuclia", email = "nucliadb@nuclia.com" }]
@@ -1,4 +1,7 @@
1
+ import json
2
+
1
3
  from google.genai import Client
4
+ from google.oauth2 import service_account
2
5
  from hyperforge.configure import driver
3
6
  from hyperforge.driver import Driver
4
7
  from typing_extensions import Self
@@ -8,8 +11,8 @@ from hyperforge_google.config import GoogleDriverConfig
8
11
 
9
12
  @driver(
10
13
  id="google",
11
- title="Google Driver",
12
- description="Driver for interacting with the Google API.",
14
+ title="Google Source",
15
+ description="Source for interacting with the Google API.",
13
16
  config_schema=GoogleDriverConfig,
14
17
  )
15
18
  class GoogleDriver(Driver):
@@ -17,11 +20,15 @@ class GoogleDriver(Driver):
17
20
 
18
21
  @classmethod
19
22
  async def init(cls, driver: GoogleDriverConfig) -> Self:
23
+
20
24
  creds = None
21
25
  if driver.config.vertexai:
22
- from google.auth import load_credentials_from_file
23
-
24
- creds, _ = load_credentials_from_file(driver.config.credentials)
26
+ if driver.config.credentials:
27
+ info = json.loads(driver.config.credentials)
28
+ creds = service_account.Credentials.from_service_account_info(
29
+ info,
30
+ scopes=["https://www.googleapis.com/auth/cloud-platform"],
31
+ )
25
32
  client = Client(
26
33
  vertexai=driver.config.vertexai,
27
34
  credentials=creds,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyperforge_google
3
- Version: 1.0.0.post35
3
+ Version: 1.0.0.post45
4
4
  Summary: Google Search Hyperforge agent
5
5
  Author-email: Nuclia <nucliadb@nuclia.com>
6
6
  License-Expression: Apache-2.0