Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #58

Merged
merged 25 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
321fda6
Merge branch 'development' of github.com:Scale3-Labs/langtrace-python…
alizenhom Mar 27, 2024
8582701
Merge branch 'development' of github.com:Scale3-Labs/langtrace-python…
alizenhom Mar 28, 2024
3582bf8
Merge branch 'development' of https://github.com/Scale3-Labs/langtrac…
MayuriS24 Mar 29, 2024
99fb8f0
Merge branch 'test_c' of https://github.com/Scale3-Labs/langtrace-pyt…
MayuriS24 Mar 30, 2024
d490171
Merge branch 'development' of https://github.com/Scale3-Labs/langtrac…
MayuriS24 Mar 30, 2024
b6d470a
Merge branch 'karthik/bug-fix' of https://github.com/Scale3-Labs/lang…
MayuriS24 Mar 30, 2024
e64b730
Updated test_chat_completion and added test_anthropic. Updated tests/…
MayuriS24 Mar 30, 2024
79766f6
Updated tests/utils
MayuriS24 Mar 30, 2024
20e1d9d
updated langchain test cases
MayuriS24 Apr 3, 2024
5124e79
Merge branch 'development' of https://github.com/Scale3-Labs/langtrac…
MayuriS24 Apr 3, 2024
5a2e21e
Merge branch 'test_c' of github.com:Scale3-Labs/langtrace-python-sdk …
alizenhom Apr 3, 2024
8328f04
Merge pull request #53 from Scale3-Labs/main
rohit-kadhe Apr 3, 2024
ee3b4ec
updated test_langchain
MayuriS24 Apr 3, 2024
83c855c
Merge branch 'test_c' of https://github.com/Scale3-Labs/langtrace-pyt…
MayuriS24 Apr 3, 2024
51d7389
updated test_image_generation
MayuriS24 Apr 3, 2024
6612261
Merge branch 'development' of https://github.com/Scale3-Labs/langtrac…
MayuriS24 Apr 3, 2024
74707df
Merge pull request #42 from Scale3-Labs/test_c
alizenhom Apr 3, 2024
10c98cb
Bugfix
karthikscale3 Apr 4, 2024
674e5b8
Merge branch 'development' of github.com:Scale3-Labs/langtrace-python…
karthikscale3 Apr 4, 2024
253ff70
Merge pull request #54 from Scale3-Labs/karthik/bugfix
karthikscale3 Apr 4, 2024
d33ade0
Bump version
karthikscale3 Apr 4, 2024
cd3fc15
Cleanup logging (#56)
karthikscale3 Apr 4, 2024
3b29722
Fix streaming bug (#57)
karthikscale3 Apr 4, 2024
ac4bbea
fix merge conflicts
karthikscale3 Apr 4, 2024
a94f980
Merge branch 'development' into release
karthikscale3 Apr 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/langtrace_python_sdk/extensions/langtrace_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,8 @@ def export(self, spans: typing.Sequence[ReadableSpan]) -> SpanExportResult:
data=json.dumps(data),
headers={"Content-Type": "application/json", "x-api-key": self.api_key},
)
print(f"Traces sent To {LANGTRACE_REMOTE_URL}")
return SpanExportResult.SUCCESS
except Exception as e:
print("Error sending data to remote URL", e)
return SpanExportResult.FAILURE

def shutdown(self) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

from langtrace_python_sdk.instrumentation.anthropic.patch import messages_create

import logging

logging.basicConfig(level=logging.FATAL)


class AnthropicInstrumentation(BaseInstrumentor):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

from langtrace_python_sdk.constants.instrumentation.chroma import APIS
from langtrace_python_sdk.instrumentation.chroma.patch import collection_patch
import logging

logging.basicConfig(level=logging.FATAL)


class ChromaInstrumentation(BaseInstrumentor):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

from langtrace_python_sdk.instrumentation.langchain.patch import generic_patch

import logging

logging.basicConfig(level=logging.FATAL)


def patch_module_classes(
module_name, tracer, version, task, trace_output=True, trace_input=True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

from langtrace_python_sdk.instrumentation.llamaindex.patch import generic_patch

import logging

logging.basicConfig(level=logging.FATAL)


class LlamaindexInstrumentation(BaseInstrumentor):
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import importlib.metadata
from typing import Collection

import openai
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from opentelemetry.trace import get_tracer
from wrapt import wrap_function_wrapper
Expand All @@ -12,6 +11,10 @@
images_generate,
)

import logging

logging.basicConfig(level=logging.FATAL)


class OpenAIInstrumentation(BaseInstrumentor):

Expand Down
4 changes: 1 addition & 3 deletions src/langtrace_python_sdk/instrumentation/openai/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def traced_method(wrapped, instance, args, kwargs):
try:
# Attempt to call the original method
result = wrapped(*args, **kwargs)
if kwargs.get("stream") is False:
if kwargs.get("stream") is False or kwargs.get("stream") is None:
span.set_attribute("llm.model", result.model)
if hasattr(result, "choices") and result.choices is not None:
responses = [
Expand Down Expand Up @@ -338,8 +338,6 @@ def traced_method(wrapped, instance, args, kwargs):
APIS["EMBEDDINGS_CREATE"]["METHOD"], kind=SpanKind.CLIENT
) as span:

print("Inside embeddings_create", trace.get_current_span())

for field, value in attributes.model_dump(by_alias=True).items():
if value is not None:
span.set_attribute(field, value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
from langtrace_python_sdk.constants.instrumentation.pinecone import APIS
from langtrace_python_sdk.instrumentation.pinecone.patch import generic_patch

import logging

logging.basicConfig(level=logging.FATAL)


class PineconeInstrumentation(BaseInstrumentor):
"""
Expand Down