trustgraph-bedrock 1.2.3__tar.gz → 1.2.5__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.
- {trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/PKG-INFO +1 -1
- trustgraph_bedrock-1.2.5/trustgraph/bedrock_version.py +1 -0
- {trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/trustgraph/model/text_completion/bedrock/llm.py +11 -8
- {trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/trustgraph_bedrock.egg-info/PKG-INFO +1 -1
- trustgraph_bedrock-1.2.3/trustgraph/bedrock_version.py +0 -1
- {trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/README.md +0 -0
- {trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/pyproject.toml +0 -0
- {trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/setup.cfg +0 -0
- {trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/trustgraph/model/text_completion/bedrock/__init__.py +0 -0
- {trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/trustgraph/model/text_completion/bedrock/__main__.py +0 -0
- {trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/trustgraph_bedrock.egg-info/SOURCES.txt +0 -0
- {trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/trustgraph_bedrock.egg-info/dependency_links.txt +0 -0
- {trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/trustgraph_bedrock.egg-info/entry_points.txt +0 -0
- {trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/trustgraph_bedrock.egg-info/requires.txt +0 -0
- {trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/trustgraph_bedrock.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: trustgraph-bedrock
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.5
|
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
5
|
Author-email: "trustgraph.ai" <security@trustgraph.ai>
|
6
6
|
Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "1.2.5"
|
@@ -8,10 +8,14 @@ import boto3
|
|
8
8
|
import json
|
9
9
|
import os
|
10
10
|
import enum
|
11
|
+
import logging
|
11
12
|
|
12
13
|
from .... exceptions import TooManyRequests
|
13
14
|
from .... base import LlmService, LlmResult
|
14
15
|
|
16
|
+
# Module logger
|
17
|
+
logger = logging.getLogger(__name__)
|
18
|
+
|
15
19
|
default_ident = "text-completion"
|
16
20
|
|
17
21
|
default_model = 'mistral.mistral-large-2407-v1:0'
|
@@ -145,7 +149,7 @@ class Processor(LlmService):
|
|
145
149
|
|
146
150
|
def __init__(self, **params):
|
147
151
|
|
148
|
-
|
152
|
+
logger.debug(f"Bedrock LLM initialized with params: {params}")
|
149
153
|
|
150
154
|
model = params.get("model", default_model)
|
151
155
|
temperature = params.get("temperature", default_temperature)
|
@@ -197,7 +201,7 @@ class Processor(LlmService):
|
|
197
201
|
|
198
202
|
self.bedrock = self.session.client(service_name='bedrock-runtime')
|
199
203
|
|
200
|
-
|
204
|
+
logger.info("Bedrock LLM service initialized")
|
201
205
|
|
202
206
|
def determine_variant(self, model):
|
203
207
|
|
@@ -250,9 +254,9 @@ class Processor(LlmService):
|
|
250
254
|
inputtokens = int(metadata['x-amzn-bedrock-input-token-count'])
|
251
255
|
outputtokens = int(metadata['x-amzn-bedrock-output-token-count'])
|
252
256
|
|
253
|
-
|
254
|
-
|
255
|
-
|
257
|
+
logger.debug(f"LLM output: {outputtext}")
|
258
|
+
logger.info(f"Input Tokens: {inputtokens}")
|
259
|
+
logger.info(f"Output Tokens: {outputtokens}")
|
256
260
|
|
257
261
|
resp = LlmResult(
|
258
262
|
text = outputtext,
|
@@ -265,7 +269,7 @@ class Processor(LlmService):
|
|
265
269
|
|
266
270
|
except self.bedrock.exceptions.ThrottlingException as e:
|
267
271
|
|
268
|
-
|
272
|
+
logger.warning(f"Hit rate limit: {e}")
|
269
273
|
|
270
274
|
# Leave rate limit retries to the base handler
|
271
275
|
raise TooManyRequests()
|
@@ -274,8 +278,7 @@ class Processor(LlmService):
|
|
274
278
|
|
275
279
|
# Apart from rate limits, treat all exceptions as unrecoverable
|
276
280
|
|
277
|
-
|
278
|
-
print(f"Exception: {e}")
|
281
|
+
logger.error(f"Bedrock LLM exception ({type(e).__name__}): {e}", exc_info=True)
|
279
282
|
raise e
|
280
283
|
|
281
284
|
@staticmethod
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: trustgraph-bedrock
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.5
|
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
5
|
Author-email: "trustgraph.ai" <security@trustgraph.ai>
|
6
6
|
Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "1.2.3"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/trustgraph_bedrock.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/trustgraph_bedrock.egg-info/entry_points.txt
RENAMED
File without changes
|
{trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/trustgraph_bedrock.egg-info/requires.txt
RENAMED
File without changes
|
{trustgraph_bedrock-1.2.3 → trustgraph_bedrock-1.2.5}/trustgraph_bedrock.egg-info/top_level.txt
RENAMED
File without changes
|