Skip to content

Commit 8406365

Browse files
committed
Minor fixes
1 parent 1dad48d commit 8406365

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/langtrace_python_sdk/instrumentation/anthropic/patch.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,10 @@ def traced_method(wrapped, instance, args, kwargs):
4545

4646
# extract system from kwargs and attach as a role to the prompts
4747
# we do this to keep it consistent with the openai
48-
prompts = json.dumps(kwargs.get("messages", []))
48+
prompts = kwargs.get("messages", [])
4949
system = kwargs.get("system")
5050
if system:
51-
prompts = json.dumps(
52-
[{"role": "system", "content": system}] + kwargs.get("messages", [])
53-
)
51+
prompts = [{"role": "system", "content": system}] + kwargs.get("messages", [])
5452

5553
span_attributes = {
5654
**get_langtrace_attributes(version, service_provider),

src/langtrace_python_sdk/instrumentation/openai/patch.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ def traced_method(wrapped, instance, args, kwargs):
244244
service_provider = SERVICE_PROVIDERS["PPLX"]
245245
elif "azure" in get_base_url(instance):
246246
service_provider = SERVICE_PROVIDERS["AZURE"]
247+
elif "groq" in get_base_url(instance):
248+
service_provider = SERVICE_PROVIDERS["GROQ"]
247249
llm_prompts = []
248250
for item in kwargs.get("messages", []):
249251
tools = get_tool_calls(item)

0 commit comments

Comments
 (0)