hyperforge-google 1.0.0.post38__tar.gz → 1.0.0.post49__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.post38 → hyperforge_google-1.0.0.post49}/PKG-INFO +1 -1
  2. {hyperforge_google-1.0.0.post38 → hyperforge_google-1.0.0.post49}/pyproject.toml +1 -1
  3. {hyperforge_google-1.0.0.post38 → hyperforge_google-1.0.0.post49}/src/hyperforge_google/driver.py +18 -7
  4. {hyperforge_google-1.0.0.post38 → hyperforge_google-1.0.0.post49}/src/hyperforge_google.egg-info/PKG-INFO +1 -1
  5. {hyperforge_google-1.0.0.post38 → hyperforge_google-1.0.0.post49}/README.md +0 -0
  6. {hyperforge_google-1.0.0.post38 → hyperforge_google-1.0.0.post49}/setup.cfg +0 -0
  7. {hyperforge_google-1.0.0.post38 → hyperforge_google-1.0.0.post49}/src/hyperforge_google/__init__.py +0 -0
  8. {hyperforge_google-1.0.0.post38 → hyperforge_google-1.0.0.post49}/src/hyperforge_google/agent.py +0 -0
  9. {hyperforge_google-1.0.0.post38 → hyperforge_google-1.0.0.post49}/src/hyperforge_google/config.py +0 -0
  10. {hyperforge_google-1.0.0.post38 → hyperforge_google-1.0.0.post49}/src/hyperforge_google/py.typed +0 -0
  11. {hyperforge_google-1.0.0.post38 → hyperforge_google-1.0.0.post49}/src/hyperforge_google.egg-info/SOURCES.txt +0 -0
  12. {hyperforge_google-1.0.0.post38 → hyperforge_google-1.0.0.post49}/src/hyperforge_google.egg-info/dependency_links.txt +0 -0
  13. {hyperforge_google-1.0.0.post38 → hyperforge_google-1.0.0.post49}/src/hyperforge_google.egg-info/requires.txt +0 -0
  14. {hyperforge_google-1.0.0.post38 → hyperforge_google-1.0.0.post49}/src/hyperforge_google.egg-info/top_level.txt +0 -0
  15. {hyperforge_google-1.0.0.post38 → hyperforge_google-1.0.0.post49}/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.post38
3
+ Version: 1.0.0.post49
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.post38"
7
+ version = "1.0.0.post49"
8
8
  license = "Apache-2.0"
9
9
  description = "Google Search Hyperforge agent"
10
10
  authors = [{ name = "Nuclia", email = "nucliadb@nuclia.com" }]
@@ -1,3 +1,6 @@
1
+ import json
2
+
3
+ from google.auth import load_credentials_from_dict # type: ignore
1
4
  from google.genai import Client
2
5
  from hyperforge.configure import driver
3
6
  from hyperforge.driver import Driver
@@ -17,17 +20,25 @@ class GoogleDriver(Driver):
17
20
 
18
21
  @classmethod
19
22
  async def init(cls, driver: GoogleDriverConfig) -> Self:
20
- creds = None
21
- if driver.config.vertexai:
22
- from google.auth import load_credentials_from_file
23
23
 
24
- creds, _ = load_credentials_from_file(driver.config.credentials)
24
+ credentials = None
25
+ location = None
26
+ if driver.config.vertexai:
27
+ if driver.config.credentials:
28
+ info = json.loads(driver.config.credentials)
29
+ credentials, project = load_credentials_from_dict(
30
+ info,
31
+ scopes=["https://www.googleapis.com/auth/cloud-platform"],
32
+ )
33
+ else:
34
+ project = driver.config.location
35
+ location = driver.config.location
25
36
  client = Client(
26
37
  vertexai=driver.config.vertexai,
27
- credentials=creds,
38
+ credentials=credentials,
28
39
  api_key=driver.config.api_key,
29
- project=driver.config.project,
30
- location=driver.config.location,
40
+ project=project,
41
+ location=location,
31
42
  )
32
43
  return cls(
33
44
  client=client,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyperforge_google
3
- Version: 1.0.0.post38
3
+ Version: 1.0.0.post49
4
4
  Summary: Google Search Hyperforge agent
5
5
  Author-email: Nuclia <nucliadb@nuclia.com>
6
6
  License-Expression: Apache-2.0