Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 2 additions & 5 deletions src/langtrace_python_sdk/instrumentation/mistral/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@


def chat_complete(original_method, version, tracer, is_async=False, is_streaming=False):

def traced_method(wrapped, instance, args, kwargs):
service_provider = SERVICE_PROVIDERS["MISTRAL"]
llm_prompts = []
Expand All @@ -65,7 +65,6 @@ def traced_method(wrapped, instance, args, kwargs):

attributes = LLMSpanAttributes(**span_attributes)


span = tracer.start_span(
name=get_span_name(APIS[api]["METHOD"]),
kind=SpanKind.CLIENT,
Expand All @@ -87,7 +86,6 @@ def traced_method(wrapped, instance, args, kwargs):
span.set_status(StatusCode.OK)
span.end()
return result


except Exception as error:
span.record_exception(error)
Expand Down Expand Up @@ -186,7 +184,6 @@ def _set_response_attributes(span, kwargs, result):
for choice in result.choices
]
set_event_completion(span, responses)

# Get the usage
if hasattr(result, "usage") and result.usage is not None:
set_usage_attributes(span, result.usage)
set_usage_attributes(span, dict(result.usage))
2 changes: 1 addition & 1 deletion src/langtrace_python_sdk/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.3.8"
__version__ = "3.3.9"
Loading