langtrace-python-sdk 3.3.25__py3-none-any.whl → 3.3.27__py3-none-any.whl
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.
- examples/awsbedrock_examples/__init__.py +3 -1
- examples/awsbedrock_examples/converse.py +11 -0
- langtrace_python_sdk/instrumentation/aws_bedrock/instrumentation.py +5 -0
- langtrace_python_sdk/version.py +1 -1
- {langtrace_python_sdk-3.3.25.dist-info → langtrace_python_sdk-3.3.27.dist-info}/METADATA +2 -1
- {langtrace_python_sdk-3.3.25.dist-info → langtrace_python_sdk-3.3.27.dist-info}/RECORD +9 -9
- {langtrace_python_sdk-3.3.25.dist-info → langtrace_python_sdk-3.3.27.dist-info}/WHEEL +0 -0
- {langtrace_python_sdk-3.3.25.dist-info → langtrace_python_sdk-3.3.27.dist-info}/entry_points.txt +0 -0
- {langtrace_python_sdk-3.3.25.dist-info → langtrace_python_sdk-3.3.27.dist-info}/licenses/LICENSE +0 -0
@@ -1,5 +1,6 @@
|
|
1
1
|
from examples.awsbedrock_examples.converse import (
|
2
2
|
use_invoke_model_anthropic,
|
3
|
+
init_bedrock_langchain,
|
3
4
|
use_invoke_model_titan,
|
4
5
|
use_invoke_model_llama,
|
5
6
|
)
|
@@ -15,4 +16,5 @@ class AWSBedrockRunner:
|
|
15
16
|
# use_invoke_model_anthropic(stream=True)
|
16
17
|
# use_invoke_model_cohere()
|
17
18
|
# use_invoke_model_llama(stream=False)
|
18
|
-
use_invoke_model_titan(stream=False)
|
19
|
+
# use_invoke_model_titan(stream=False)
|
20
|
+
init_bedrock_langchain()
|
@@ -3,6 +3,7 @@ import json
|
|
3
3
|
from langtrace_python_sdk import langtrace
|
4
4
|
from dotenv import load_dotenv
|
5
5
|
import botocore
|
6
|
+
from langchain_aws import ChatBedrock
|
6
7
|
|
7
8
|
load_dotenv()
|
8
9
|
langtrace.init(write_spans_to_console=False)
|
@@ -186,3 +187,13 @@ def use_invoke_model_cohere():
|
|
186
187
|
response = brt.invoke_model(body=body, modelId=model_id)
|
187
188
|
response_body = json.loads(response.get("body").read())
|
188
189
|
print(response_body)
|
190
|
+
|
191
|
+
|
192
|
+
def init_bedrock_langchain(temperature=0.1):
|
193
|
+
chat = ChatBedrock(
|
194
|
+
model_id="anthropic.claude-v2",
|
195
|
+
streaming=True,
|
196
|
+
model_kwargs={"temperature": temperature},
|
197
|
+
region_name="us-east-1",
|
198
|
+
)
|
199
|
+
return chat.invoke("What is the capital of France?")
|
@@ -42,6 +42,11 @@ class AWSBedrockInstrumentation(BaseInstrumentor):
|
|
42
42
|
name="client",
|
43
43
|
wrapper=patch_aws_bedrock(tracer, version),
|
44
44
|
)
|
45
|
+
_W(
|
46
|
+
module="boto3.session",
|
47
|
+
name="Session.client",
|
48
|
+
wrapper=patch_aws_bedrock(tracer, version),
|
49
|
+
)
|
45
50
|
|
46
51
|
def _uninstrument(self, **kwargs):
|
47
52
|
pass
|
langtrace_python_sdk/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "3.3.
|
1
|
+
__version__ = "3.3.27"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: langtrace-python-sdk
|
3
|
-
Version: 3.3.
|
3
|
+
Version: 3.3.27
|
4
4
|
Summary: Python SDK for LangTrace
|
5
5
|
Project-URL: Homepage, https://github.com/Scale3-Labs/langtrace-python-sdk
|
6
6
|
Author-email: Scale3 Labs <engineering@scale3labs.com>
|
@@ -27,6 +27,7 @@ Requires-Dist: ujson>=5.10.0
|
|
27
27
|
Provides-Extra: dev
|
28
28
|
Requires-Dist: anthropic; extra == 'dev'
|
29
29
|
Requires-Dist: boto3; extra == 'dev'
|
30
|
+
Requires-Dist: botocore; extra == 'dev'
|
30
31
|
Requires-Dist: chromadb; extra == 'dev'
|
31
32
|
Requires-Dist: cohere; extra == 'dev'
|
32
33
|
Requires-Dist: embedchain; extra == 'dev'
|
@@ -3,8 +3,8 @@ examples/anthropic_example/__init__.py,sha256=03us1YuvAJR6fqXX8NH2kROBfTmyz7KzFV
|
|
3
3
|
examples/anthropic_example/completion.py,sha256=3_YEZrt0BLVNJT_RbLXg6JGP2bweuc_HPC2MWR73tOM,713
|
4
4
|
examples/autogen_example/__init__.py,sha256=UJgpzL2yOmzir-DAiGFR1PB1Zz3YcQvYcq5bCN8nl0A,158
|
5
5
|
examples/autogen_example/main.py,sha256=6OJ73VCdHgVrqnekF1S1nK8mXCUABLbUUkQtr7wOCdw,2312
|
6
|
-
examples/awsbedrock_examples/__init__.py,sha256=
|
7
|
-
examples/awsbedrock_examples/converse.py,sha256=
|
6
|
+
examples/awsbedrock_examples/__init__.py,sha256=ssd7M-TxKUBsi86dsJTh39-NOpJ6cKLK3WMag7lr5go,600
|
7
|
+
examples/awsbedrock_examples/converse.py,sha256=sZj4C8N-yQzUFM-ND1gMRVwqfrrvT37YdQJuXp3JR94,6270
|
8
8
|
examples/azureopenai_example/__init__.py,sha256=PaZM90r6VN4eSOXxb6wGsyhf9-RJCNqBypzk1Xa2GJI,271
|
9
9
|
examples/azureopenai_example/completion.py,sha256=K_GeU0TfJ9lLDfW5VI0Lmm8_I0JXf1x9Qi83ImJ350c,668
|
10
10
|
examples/cerebras_example/__init__.py,sha256=ydfNi0DjFMGVcfo79XVG3VEbzIrHo5wYBgSJzl_asNA,295
|
@@ -111,7 +111,7 @@ examples/weaviate_example/__init__.py,sha256=8JMDBsRSEV10HfTd-YC7xb4txBjD3la56sn
|
|
111
111
|
examples/weaviate_example/query_text.py,sha256=wPHQTc_58kPoKTZMygVjTj-2ZcdrIuaausJfMxNQnQc,127162
|
112
112
|
langtrace_python_sdk/__init__.py,sha256=VZM6i71NR7pBQK6XvJWRelknuTYUhqwqE7PlicKa5Wg,1166
|
113
113
|
langtrace_python_sdk/langtrace.py,sha256=jvfrnkAxc41dmIvwNuVcXwCWyV2vqhGV5qAr5KiMHBA,13239
|
114
|
-
langtrace_python_sdk/version.py,sha256=
|
114
|
+
langtrace_python_sdk/version.py,sha256=LAz3X1vgk9Gsvl-zwf37Ce34JFFJ7mYEirRyrbMqxhA,23
|
115
115
|
langtrace_python_sdk/constants/__init__.py,sha256=3CNYkWMdd1DrkGqzLUgNZXjdAlM6UFMlf_F-odAToyc,146
|
116
116
|
langtrace_python_sdk/constants/exporter/langtrace_exporter.py,sha256=EVCrouYCpY98f0KSaKr4PzNxPULTZZO6dSA_crEOyJU,106
|
117
117
|
langtrace_python_sdk/constants/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -146,7 +146,7 @@ langtrace_python_sdk/instrumentation/autogen/instrumentation.py,sha256=MVDUCBi6X
|
|
146
146
|
langtrace_python_sdk/instrumentation/autogen/patch.py,sha256=7Sq3C8Q5tT27UkWXd1SZgnLC1pbQf_tpTrxoBIYsDw4,5273
|
147
147
|
langtrace_python_sdk/instrumentation/aws_bedrock/__init__.py,sha256=IHqPgR1kdDvcoV1nUb-B21PaJ_qbQB0jc011Udi1ioU,96
|
148
148
|
langtrace_python_sdk/instrumentation/aws_bedrock/bedrock_streaming_wrapper.py,sha256=_EMlxfBhjNsB-2TrP0ek-vx1CK5bpgjXPmQWNT9eBcE,1370
|
149
|
-
langtrace_python_sdk/instrumentation/aws_bedrock/instrumentation.py,sha256=
|
149
|
+
langtrace_python_sdk/instrumentation/aws_bedrock/instrumentation.py,sha256=ohSlH-BPjIfQ6_wQbUyRDnVMWLY_XHeDv112J_MxC0k,1622
|
150
150
|
langtrace_python_sdk/instrumentation/aws_bedrock/patch.py,sha256=KKNp9gKzoj9YuLrqA0VMDe0FUSBzKtrbXiNN1hdciJM,17941
|
151
151
|
langtrace_python_sdk/instrumentation/aws_bedrock/stream_body_wrapper.py,sha256=ENdhRVHBhdkIlJIc_tkf8ASijUzZdVZM-oonNLdNM48,1584
|
152
152
|
langtrace_python_sdk/instrumentation/cerebras/__init__.py,sha256=9rHNg7PWcZ7a9jExQZlqwWPkvLGcPT-DGWot0_6Bx9k,92
|
@@ -277,8 +277,8 @@ tests/pinecone/cassettes/test_query.yaml,sha256=b5v9G3ssUy00oG63PlFUR3JErF2Js-5A
|
|
277
277
|
tests/pinecone/cassettes/test_upsert.yaml,sha256=neWmQ1v3d03V8WoLl8FoFeeCYImb8pxlJBWnFd_lITU,38607
|
278
278
|
tests/qdrant/conftest.py,sha256=9n0uHxxIjWk9fbYc4bx-uP8lSAgLBVx-cV9UjnsyCHM,381
|
279
279
|
tests/qdrant/test_qdrant.py,sha256=pzjAjVY2kmsmGfrI2Gs2xrolfuaNHz7l1fqGQCjp5_o,3353
|
280
|
-
langtrace_python_sdk-3.3.
|
281
|
-
langtrace_python_sdk-3.3.
|
282
|
-
langtrace_python_sdk-3.3.
|
283
|
-
langtrace_python_sdk-3.3.
|
284
|
-
langtrace_python_sdk-3.3.
|
280
|
+
langtrace_python_sdk-3.3.27.dist-info/METADATA,sha256=uib3DFDvv41ZHpvKdp1g1M6-DenvXhuvilf0Y4MH_e0,15716
|
281
|
+
langtrace_python_sdk-3.3.27.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
282
|
+
langtrace_python_sdk-3.3.27.dist-info/entry_points.txt,sha256=1_b9-qvf2fE7uQNZcbUei9vLpFZBbbh9LrtGw95ssAo,70
|
283
|
+
langtrace_python_sdk-3.3.27.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
284
|
+
langtrace_python_sdk-3.3.27.dist-info/RECORD,,
|
File without changes
|
{langtrace_python_sdk-3.3.25.dist-info → langtrace_python_sdk-3.3.27.dist-info}/entry_points.txt
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.25.dist-info → langtrace_python_sdk-3.3.27.dist-info}/licenses/LICENSE
RENAMED
File without changes
|