trustgraph-vertexai 1.2.0__tar.gz → 1.2.4__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.
Potentially problematic release.
This version of trustgraph-vertexai might be problematic. Click here for more details.
- {trustgraph-vertexai-1.2.0 → trustgraph_vertexai-1.2.4}/PKG-INFO +8 -7
- trustgraph_vertexai-1.2.4/pyproject.toml +33 -0
- {trustgraph-vertexai-1.2.0 → trustgraph_vertexai-1.2.4}/trustgraph/model/text_completion/vertexai/llm.py +12 -8
- trustgraph_vertexai-1.2.4/trustgraph/vertexai_version.py +1 -0
- {trustgraph-vertexai-1.2.0 → trustgraph_vertexai-1.2.4}/trustgraph_vertexai.egg-info/PKG-INFO +8 -7
- {trustgraph-vertexai-1.2.0 → trustgraph_vertexai-1.2.4}/trustgraph_vertexai.egg-info/SOURCES.txt +2 -2
- trustgraph_vertexai-1.2.4/trustgraph_vertexai.egg-info/entry_points.txt +2 -0
- {trustgraph-vertexai-1.2.0 → trustgraph_vertexai-1.2.4}/trustgraph_vertexai.egg-info/top_level.txt +0 -1
- trustgraph-vertexai-1.2.0/scripts/text-completion-vertexai +0 -6
- trustgraph-vertexai-1.2.0/setup.py +0 -45
- trustgraph-vertexai-1.2.0/trustgraph/vertexai_version.py +0 -1
- {trustgraph-vertexai-1.2.0 → trustgraph_vertexai-1.2.4}/README.md +0 -0
- {trustgraph-vertexai-1.2.0 → trustgraph_vertexai-1.2.4}/setup.cfg +0 -0
- {trustgraph-vertexai-1.2.0 → trustgraph_vertexai-1.2.4}/trustgraph/model/text_completion/vertexai/__init__.py +0 -0
- {trustgraph-vertexai-1.2.0 → trustgraph_vertexai-1.2.4}/trustgraph/model/text_completion/vertexai/__main__.py +0 -0
- {trustgraph-vertexai-1.2.0 → trustgraph_vertexai-1.2.4}/trustgraph_vertexai.egg-info/dependency_links.txt +0 -0
- {trustgraph-vertexai-1.2.0 → trustgraph_vertexai-1.2.4}/trustgraph_vertexai.egg-info/requires.txt +2 -2
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: trustgraph-vertexai
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Author: trustgraph.ai
|
|
8
|
-
Author-email: security@trustgraph.ai
|
|
5
|
+
Author-email: "trustgraph.ai" <security@trustgraph.ai>
|
|
6
|
+
Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
|
|
9
7
|
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
11
8
|
Classifier: Operating System :: OS Independent
|
|
12
9
|
Requires-Python: >=3.8
|
|
13
10
|
Description-Content-Type: text/markdown
|
|
11
|
+
Requires-Dist: trustgraph-base<1.3,>=1.2
|
|
12
|
+
Requires-Dist: pulsar-client
|
|
13
|
+
Requires-Dist: google-cloud-aiplatform
|
|
14
|
+
Requires-Dist: prometheus-client
|
|
14
15
|
|
|
15
16
|
See https://trustgraph.ai/
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "trustgraph-vertexai"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
authors = [{name = "trustgraph.ai", email = "security@trustgraph.ai"}]
|
|
9
|
+
description = "TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline."
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
requires-python = ">=3.8"
|
|
12
|
+
dependencies = [
|
|
13
|
+
"trustgraph-base>=1.2,<1.3",
|
|
14
|
+
"pulsar-client",
|
|
15
|
+
"google-cloud-aiplatform",
|
|
16
|
+
"prometheus-client",
|
|
17
|
+
]
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Operating System :: OS Independent",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.urls]
|
|
24
|
+
Homepage = "https://github.com/trustgraph-ai/trustgraph"
|
|
25
|
+
|
|
26
|
+
[project.scripts]
|
|
27
|
+
text-completion-vertexai = "trustgraph.model.text_completion.vertexai:run"
|
|
28
|
+
|
|
29
|
+
[tool.setuptools.packages.find]
|
|
30
|
+
include = ["trustgraph*"]
|
|
31
|
+
|
|
32
|
+
[tool.setuptools.dynamic]
|
|
33
|
+
version = {attr = "trustgraph.vertexai_version.__version__"}
|
|
@@ -19,6 +19,7 @@ Google Cloud. Input is prompt, output is response.
|
|
|
19
19
|
from google.oauth2 import service_account
|
|
20
20
|
import google
|
|
21
21
|
import vertexai
|
|
22
|
+
import logging
|
|
22
23
|
|
|
23
24
|
# Why is preview here?
|
|
24
25
|
from vertexai.generative_models import (
|
|
@@ -29,6 +30,9 @@ from vertexai.generative_models import (
|
|
|
29
30
|
from .... exceptions import TooManyRequests
|
|
30
31
|
from .... base import LlmService, LlmResult
|
|
31
32
|
|
|
33
|
+
# Module logger
|
|
34
|
+
logger = logging.getLogger(__name__)
|
|
35
|
+
|
|
32
36
|
default_ident = "text-completion"
|
|
33
37
|
|
|
34
38
|
default_model = 'gemini-2.0-flash-001'
|
|
@@ -91,7 +95,7 @@ class Processor(LlmService):
|
|
|
91
95
|
),
|
|
92
96
|
]
|
|
93
97
|
|
|
94
|
-
|
|
98
|
+
logger.info("Initializing VertexAI...")
|
|
95
99
|
|
|
96
100
|
if private_key:
|
|
97
101
|
credentials = (
|
|
@@ -113,11 +117,11 @@ class Processor(LlmService):
|
|
|
113
117
|
location=region
|
|
114
118
|
)
|
|
115
119
|
|
|
116
|
-
|
|
120
|
+
logger.info(f"Initializing model {model}")
|
|
117
121
|
self.llm = GenerativeModel(model)
|
|
118
122
|
self.model = model
|
|
119
123
|
|
|
120
|
-
|
|
124
|
+
logger.info("VertexAI initialization complete")
|
|
121
125
|
|
|
122
126
|
async def generate_content(self, system, prompt):
|
|
123
127
|
|
|
@@ -137,16 +141,16 @@ class Processor(LlmService):
|
|
|
137
141
|
model = self.model
|
|
138
142
|
)
|
|
139
143
|
|
|
140
|
-
|
|
141
|
-
|
|
144
|
+
logger.info(f"Input Tokens: {resp.in_token}")
|
|
145
|
+
logger.info(f"Output Tokens: {resp.out_token}")
|
|
142
146
|
|
|
143
|
-
|
|
147
|
+
logger.debug("Send response...")
|
|
144
148
|
|
|
145
149
|
return resp
|
|
146
150
|
|
|
147
151
|
except google.api_core.exceptions.ResourceExhausted as e:
|
|
148
152
|
|
|
149
|
-
|
|
153
|
+
logger.warning(f"Hit rate limit: {e}")
|
|
150
154
|
|
|
151
155
|
# Leave rate limit retries to the base handler
|
|
152
156
|
raise TooManyRequests()
|
|
@@ -154,7 +158,7 @@ class Processor(LlmService):
|
|
|
154
158
|
except Exception as e:
|
|
155
159
|
|
|
156
160
|
# Apart from rate limits, treat all exceptions as unrecoverable
|
|
157
|
-
|
|
161
|
+
logger.error(f"VertexAI LLM exception: {e}", exc_info=True)
|
|
158
162
|
raise e
|
|
159
163
|
|
|
160
164
|
@staticmethod
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.2.4"
|
{trustgraph-vertexai-1.2.0 → trustgraph_vertexai-1.2.4}/trustgraph_vertexai.egg-info/PKG-INFO
RENAMED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: trustgraph-vertexai
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Author: trustgraph.ai
|
|
8
|
-
Author-email: security@trustgraph.ai
|
|
5
|
+
Author-email: "trustgraph.ai" <security@trustgraph.ai>
|
|
6
|
+
Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
|
|
9
7
|
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
11
8
|
Classifier: Operating System :: OS Independent
|
|
12
9
|
Requires-Python: >=3.8
|
|
13
10
|
Description-Content-Type: text/markdown
|
|
11
|
+
Requires-Dist: trustgraph-base<1.3,>=1.2
|
|
12
|
+
Requires-Dist: pulsar-client
|
|
13
|
+
Requires-Dist: google-cloud-aiplatform
|
|
14
|
+
Requires-Dist: prometheus-client
|
|
14
15
|
|
|
15
16
|
See https://trustgraph.ai/
|
{trustgraph-vertexai-1.2.0 → trustgraph_vertexai-1.2.4}/trustgraph_vertexai.egg-info/SOURCES.txt
RENAMED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
README.md
|
|
2
|
-
|
|
3
|
-
scripts/text-completion-vertexai
|
|
2
|
+
pyproject.toml
|
|
4
3
|
trustgraph/vertexai_version.py
|
|
5
4
|
trustgraph/model/text_completion/vertexai/__init__.py
|
|
6
5
|
trustgraph/model/text_completion/vertexai/__main__.py
|
|
@@ -8,5 +7,6 @@ trustgraph/model/text_completion/vertexai/llm.py
|
|
|
8
7
|
trustgraph_vertexai.egg-info/PKG-INFO
|
|
9
8
|
trustgraph_vertexai.egg-info/SOURCES.txt
|
|
10
9
|
trustgraph_vertexai.egg-info/dependency_links.txt
|
|
10
|
+
trustgraph_vertexai.egg-info/entry_points.txt
|
|
11
11
|
trustgraph_vertexai.egg-info/requires.txt
|
|
12
12
|
trustgraph_vertexai.egg-info/top_level.txt
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import setuptools
|
|
2
|
-
import os
|
|
3
|
-
import importlib
|
|
4
|
-
|
|
5
|
-
with open("README.md", "r") as fh:
|
|
6
|
-
long_description = fh.read()
|
|
7
|
-
|
|
8
|
-
# Load a version number module
|
|
9
|
-
spec = importlib.util.spec_from_file_location(
|
|
10
|
-
'version', 'trustgraph/vertexai_version.py'
|
|
11
|
-
)
|
|
12
|
-
version_module = importlib.util.module_from_spec(spec)
|
|
13
|
-
spec.loader.exec_module(version_module)
|
|
14
|
-
|
|
15
|
-
version = version_module.__version__
|
|
16
|
-
|
|
17
|
-
setuptools.setup(
|
|
18
|
-
name="trustgraph-vertexai",
|
|
19
|
-
version=version,
|
|
20
|
-
author="trustgraph.ai",
|
|
21
|
-
author_email="security@trustgraph.ai",
|
|
22
|
-
description="TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.",
|
|
23
|
-
long_description=long_description,
|
|
24
|
-
long_description_content_type="text/markdown",
|
|
25
|
-
url="https://github.com/trustgraph-ai/trustgraph",
|
|
26
|
-
packages=setuptools.find_namespace_packages(
|
|
27
|
-
where='./',
|
|
28
|
-
),
|
|
29
|
-
classifiers=[
|
|
30
|
-
"Programming Language :: Python :: 3",
|
|
31
|
-
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
|
|
32
|
-
"Operating System :: OS Independent",
|
|
33
|
-
],
|
|
34
|
-
python_requires='>=3.8',
|
|
35
|
-
download_url = "https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v" + version + ".tar.gz",
|
|
36
|
-
install_requires=[
|
|
37
|
-
"trustgraph-base>=1.2,<1.3",
|
|
38
|
-
"pulsar-client",
|
|
39
|
-
"google-cloud-aiplatform",
|
|
40
|
-
"prometheus-client",
|
|
41
|
-
],
|
|
42
|
-
scripts=[
|
|
43
|
-
"scripts/text-completion-vertexai",
|
|
44
|
-
]
|
|
45
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.2.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|