Skip to content

Commit

Permalink
Release (#61)
Browse files Browse the repository at this point in the history
* Updated test_chat_completion and added test_anthropic. Updated tests/utils

* Updated tests/utils

* updated langchain test cases

* updated test_langchain

* updated test_image_generation

* Bugfix

* Bump version

* Cleanup logging (#56)

* Fix streaming bug (#57)

* Cleanup logging

* Fix streaming bug

* bump version

* add sdk name (#60)

---------

Co-authored-by: Ali Waleed <[email protected]>
Co-authored-by: MayuriS24 <[email protected]>
Co-authored-by: Rohit Kadhe <[email protected]>
  • Loading branch information
4 people authored Apr 4, 2024
1 parent 0b3a74c commit 6ad0a89
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def traced_method(wrapped, instance, args, kwargs):
extra_attributes = baggage.get_baggage(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY)

span_attributes = {
"langtrace.sdk.name": "langtrace-python-sdk",
"langtrace.service.name": service_provider,
"langtrace.service.type": "llm",
"langtrace.service.version": version,
Expand Down
1 change: 1 addition & 0 deletions src/langtrace_python_sdk/instrumentation/chroma/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def traced_method(wrapped, instance, args, kwargs):
extra_attributes = baggage.get_baggage(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY)

span_attributes = {
"langtrace.sdk.name": "langtrace-python-sdk",
"langtrace.service.name": service_provider,
"langtrace.service.type": "vectordb",
"langtrace.service.version": version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def traced_method(wrapped, instance, args, kwargs):
extra_attributes = baggage.get_baggage(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY)

span_attributes = {
"langtrace.sdk.name": "langtrace-python-sdk",
"langtrace.service.name": service_provider,
"langtrace.service.type": "framework",
"langtrace.service.version": version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def traced_method(wrapped, instance, args, kwargs):
extra_attributes = baggage.get_baggage(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY)

span_attributes = {
"langtrace.sdk.name": "langtrace-python-sdk",
"langtrace.service.name": service_provider,
"langtrace.service.type": "framework",
"langtrace.service.version": version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def traced_method(wrapped, instance, args, kwargs):
extra_attributes = baggage.get_baggage(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY)

span_attributes = {
"langtrace.sdk.name": "langtrace-python-sdk",
"langtrace.service.name": service_provider,
"langtrace.service.type": "framework",
"langtrace.service.version": version,
Expand Down Expand Up @@ -96,6 +97,7 @@ def runnable_patch(
def traced_method(wrapped, instance, args, kwargs):
service_provider = SERVICE_PROVIDERS["LANGCHAIN_CORE"]
span_attributes = {
"langtrace.sdk.name": "langtrace-python-sdk",
"langtrace.service.name": service_provider,
"langtrace.service.type": "framework",
"langtrace.service.version": version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def traced_method(wrapped, instance, args, kwargs):
extra_attributes = baggage.get_baggage(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY)

span_attributes = {
"langtrace.sdk.name": "langtrace-python-sdk",
"langtrace.service.name": service_provider,
"langtrace.service.type": "framework",
"langtrace.service.version": version,
Expand Down
3 changes: 3 additions & 0 deletions src/langtrace_python_sdk/instrumentation/openai/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def traced_method(wrapped, instance, args, kwargs):
extra_attributes = baggage.get_baggage(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY)

span_attributes = {
"langtrace.sdk.name": "langtrace-python-sdk",
"langtrace.service.name": service_provider,
"langtrace.service.type": "llm",
"langtrace.service.version": version,
Expand Down Expand Up @@ -99,6 +100,7 @@ def traced_method(wrapped, instance, args, kwargs):
extra_attributes = baggage.get_baggage(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY)

span_attributes = {
"langtrace.sdk.name": "langtrace-python-sdk",
"langtrace.service.name": service_provider,
"langtrace.service.type": "llm",
"langtrace.service.version": version,
Expand Down Expand Up @@ -313,6 +315,7 @@ def traced_method(wrapped, instance, args, kwargs):
extra_attributes = baggage.get_baggage(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY)

span_attributes = {
"langtrace.sdk.name": "langtrace-python-sdk",
"langtrace.service.name": service_provider,
"langtrace.service.type": "llm",
"langtrace.service.version": version,
Expand Down
1 change: 1 addition & 0 deletions src/langtrace_python_sdk/instrumentation/pinecone/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def traced_method(wrapped, instance, args, kwargs):
extra_attributes = baggage.get_baggage(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY)

span_attributes = {
"langtrace.sdk.name": "langtrace-python-sdk",
"langtrace.service.name": service_provider,
"langtrace.service.type": "vectordb",
"langtrace.service.version": version,
Expand Down
1 change: 1 addition & 0 deletions src/tests/anthropic/test_anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def test_anthropic(self):
self.assertTrue(self.span.set_status.has_calls([call(Status(StatusCode.OK))]))

expected_attributes = {
"langtrace.sdk.name": "langtrace-python-sdk",
"langtrace.service.name": "Anthropic",
"langtrace.service.type": "llm",
"langtrace.service.version": version,
Expand Down
1 change: 1 addition & 0 deletions src/tests/chroma/test_chroma.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def test_collection_patch_success(self):

# Verify span attributes are set as expected
expected_attributes = {
'langtrace.sdk.name': 'langtrace-python-sdk',
'langtrace.service.name': 'Chroma',
'langtrace.service.type': 'vectordb',
'langtrace.service.version': '1.2.3',
Expand Down
1 change: 1 addition & 0 deletions src/tests/langchain/test_langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def test_generic_patch(self):

service_provider = "Langchain"
expected_attributes = {
'langtrace.sdk.name': 'langtrace-python-sdk',
"langtrace.service.name": service_provider,
"langtrace.service.type": "framework",
"langtrace.service.version": version,
Expand Down
1 change: 1 addition & 0 deletions src/tests/langchain/test_langchain_community.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def test_generic_patch(self):

service_provider = "Langchain Community"
expected_attributes = {
'langtrace.sdk.name': 'langtrace-python-sdk',
"langtrace.service.name": service_provider,
"langtrace.service.type": "framework",
"langtrace.service.version": version,
Expand Down
2 changes: 2 additions & 0 deletions src/tests/langchain/test_langchain_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def test_generic_patch(self):

service_provider = "Langchain Core"
expected_attributes = {
'langtrace.sdk.name': 'langtrace-python-sdk',
"langtrace.service.name": service_provider,
"langtrace.service.type": "framework",
"langtrace.service.version": version,
Expand Down Expand Up @@ -82,6 +83,7 @@ def test_runnable_patch(self):

service_provider = "Langchain Core"
expected_attributes = {
'langtrace.sdk.name': 'langtrace-python-sdk',
"langtrace.service.name": service_provider,
"langtrace.service.type": "framework",
"langtrace.service.version": version,
Expand Down
1 change: 1 addition & 0 deletions src/tests/openai/test_chat_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def test_chat_completions_create_non_streaming(self):
self.assertTrue(self.tracer.start_as_current_span.called_once_with("openai.chat.completions.create", kind=SpanKind.CLIENT))

expected_attributes = {
'langtrace.sdk.name': 'langtrace-python-sdk',
"langtrace.service.name": "OpenAI",
"langtrace.service.type": "llm",
"langtrace.service.version": version,
Expand Down
1 change: 1 addition & 0 deletions src/tests/openai/test_image_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_image_generation(self):
self.assertTrue(self.tracer.start_as_current_span.called_once_with("openai.images.generate", kind=SpanKind.CLIENT))

expected_attributes = {
'langtrace.sdk.name': 'langtrace-python-sdk',
"langtrace.service.name": "OpenAI",
"langtrace.service.type": "llm",
"langtrace.service.version": version,
Expand Down
1 change: 1 addition & 0 deletions src/tests/pinecone/test_pinecone.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def test_pinecone(self):
api = APIS[method]
service_provider = SERVICE_PROVIDERS["PINECONE"]
expected_attributes = {
'langtrace.sdk.name': 'langtrace-python-sdk',
"langtrace.service.name": service_provider,
"langtrace.service.type": "vectordb",
"langtrace.service.version": version,
Expand Down

0 comments on commit 6ad0a89

Please sign in to comment.