hyperforge-google 1.0.0.post45__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.post45 → hyperforge_google-1.0.0.post49}/PKG-INFO +1 -1
  2. {hyperforge_google-1.0.0.post45 → hyperforge_google-1.0.0.post49}/pyproject.toml +1 -1
  3. {hyperforge_google-1.0.0.post45 → hyperforge_google-1.0.0.post49}/src/hyperforge_google/driver.py +10 -6
  4. {hyperforge_google-1.0.0.post45 → hyperforge_google-1.0.0.post49}/src/hyperforge_google.egg-info/PKG-INFO +1 -1
  5. {hyperforge_google-1.0.0.post45 → hyperforge_google-1.0.0.post49}/README.md +0 -0
  6. {hyperforge_google-1.0.0.post45 → hyperforge_google-1.0.0.post49}/setup.cfg +0 -0
  7. {hyperforge_google-1.0.0.post45 → hyperforge_google-1.0.0.post49}/src/hyperforge_google/__init__.py +0 -0
  8. {hyperforge_google-1.0.0.post45 → hyperforge_google-1.0.0.post49}/src/hyperforge_google/agent.py +0 -0
  9. {hyperforge_google-1.0.0.post45 → hyperforge_google-1.0.0.post49}/src/hyperforge_google/config.py +0 -0
  10. {hyperforge_google-1.0.0.post45 → hyperforge_google-1.0.0.post49}/src/hyperforge_google/py.typed +0 -0
  11. {hyperforge_google-1.0.0.post45 → hyperforge_google-1.0.0.post49}/src/hyperforge_google.egg-info/SOURCES.txt +0 -0
  12. {hyperforge_google-1.0.0.post45 → hyperforge_google-1.0.0.post49}/src/hyperforge_google.egg-info/dependency_links.txt +0 -0
  13. {hyperforge_google-1.0.0.post45 → hyperforge_google-1.0.0.post49}/src/hyperforge_google.egg-info/requires.txt +0 -0
  14. {hyperforge_google-1.0.0.post45 → hyperforge_google-1.0.0.post49}/src/hyperforge_google.egg-info/top_level.txt +0 -0
  15. {hyperforge_google-1.0.0.post45 → 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.post45
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.post45"
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,7 +1,7 @@
1
1
  import json
2
2
 
3
+ from google.auth import load_credentials_from_dict # type: ignore
3
4
  from google.genai import Client
4
- from google.oauth2 import service_account
5
5
  from hyperforge.configure import driver
6
6
  from hyperforge.driver import Driver
7
7
  from typing_extensions import Self
@@ -21,20 +21,24 @@ class GoogleDriver(Driver):
21
21
  @classmethod
22
22
  async def init(cls, driver: GoogleDriverConfig) -> Self:
23
23
 
24
- creds = None
24
+ credentials = None
25
+ location = None
25
26
  if driver.config.vertexai:
26
27
  if driver.config.credentials:
27
28
  info = json.loads(driver.config.credentials)
28
- creds = service_account.Credentials.from_service_account_info(
29
+ credentials, project = load_credentials_from_dict(
29
30
  info,
30
31
  scopes=["https://www.googleapis.com/auth/cloud-platform"],
31
32
  )
33
+ else:
34
+ project = driver.config.location
35
+ location = driver.config.location
32
36
  client = Client(
33
37
  vertexai=driver.config.vertexai,
34
- credentials=creds,
38
+ credentials=credentials,
35
39
  api_key=driver.config.api_key,
36
- project=driver.config.project,
37
- location=driver.config.location,
40
+ project=project,
41
+ location=location,
38
42
  )
39
43
  return cls(
40
44
  client=client,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyperforge_google
3
- Version: 1.0.0.post45
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