lucidicai 1.2.20__py3-none-any.whl → 1.2.21__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.
@@ -352,7 +352,21 @@ class LucidicSpanProcessor(SpanProcessor):
352
352
  if tool_name:
353
353
  if DEBUG:
354
354
  logger.info(f"[SpanProcessor] Found openai agents tool call: {tool_name}")
355
- return f"Agent Tool Call: {tool_name}"
355
+
356
+ # Extract and format tool parameters
357
+ tool_params_str = attributes.get('gen_ai.tool.parameters')
358
+ if tool_params_str:
359
+ try:
360
+ # Parse the JSON string
361
+ tool_params = json.loads(tool_params_str)
362
+ # Format the parameters nicely
363
+ formatted_params = json.dumps(tool_params, indent=2)
364
+ return f"Agent Tool Call: {tool_name}\nParameters:{formatted_params}"
365
+ except json.JSONDecodeError:
366
+ # If parsing fails, just include the raw string
367
+ return f"Agent Tool Call: {tool_name}\nParameters: {tool_params_str}"
368
+ else:
369
+ return f"Agent Tool Call: {tool_name}"
356
370
 
357
371
  # Fallback
358
372
  if DEBUG:
@@ -491,6 +505,30 @@ class LucidicSpanProcessor(SpanProcessor):
491
505
  if DEBUG:
492
506
  logger.info(f"[SpanProcessor -- Agent Tool Call Response Received]") # span attributes: {attributes}")
493
507
 
508
+ # Check the operation type to determine what kind of response this is
509
+ operation_name = attributes.get('gen_ai.operation.name')
510
+ tool_result = attributes.get('gen_ai.tool.result')
511
+ agent_name = attributes.get('gen_ai.agent.name')
512
+
513
+ # For function/tool spans, just show the tool result
514
+ if operation_name == 'function' and tool_result:
515
+ return f"Tool Result: {tool_result}"
516
+
517
+ # For agent spans or response spans without tool results, this might be a handoff
518
+ # We can check if there's actual completion content
519
+ completion_content = None
520
+ for i in range(10): # Check up to 10 completions
521
+ content = attributes.get(f'gen_ai.completion.{i}.content')
522
+ if content:
523
+ completion_content = content
524
+ break
525
+
526
+ # If we have completion content, return it (this is the actual agent response)
527
+ if completion_content:
528
+ return completion_content
529
+
530
+ # Otherwise, this is likely a handoff scenario
531
+ # Since we can't determine the next agent, just indicate a handoff occurred
494
532
  return "Agent Handoff"
495
533
 
496
534
  return "Response received"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lucidicai
3
- Version: 1.2.20
3
+ Version: 1.2.21
4
4
  Summary: Lucidic AI Python SDK
5
5
  Author: Andy Liang
6
6
  Author-email: andy@lucidic.ai
@@ -33,7 +33,7 @@ lucidicai/telemetry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
33
33
  lucidicai/telemetry/base_provider.py,sha256=nrZVr4Y9xcAiMn4uAN3t3k6DlHNTvlXrA4qQg7lANOQ,544
34
34
  lucidicai/telemetry/litellm_bridge.py,sha256=mOdjEfvP--ToDv8snoOMU4pRQx_Yg4s2o3BMTMzeRK8,14979
35
35
  lucidicai/telemetry/lucidic_exporter.py,sha256=h2GOnEk22Fpeke4Zc7SSk391yr0joUApVwolV5Q4hz4,10818
36
- lucidicai/telemetry/lucidic_span_processor.py,sha256=LhkyJGBnTKpTWdBi2wyW9th4CWZ9EtZ8ulaE0rwYj0Y,27432
36
+ lucidicai/telemetry/lucidic_span_processor.py,sha256=Hf15USiY2smfr29HXwmMRy7SNLwuLJg5wCUdLKjOp3Y,29420
37
37
  lucidicai/telemetry/openai_agents_instrumentor.py,sha256=__wIbeglMnEEf4AGTQ--FXeWCKmz2yy8SBupwprEdZA,12694
38
38
  lucidicai/telemetry/opentelemetry_converter.py,sha256=xOHCqoTyO4hUkL6k7fxy84PbljPpYep6ET9ZqbkJehc,17665
39
39
  lucidicai/telemetry/otel_handlers.py,sha256=HqGYIWJI_Vp8So2-HMpPjnrgTBSgBHHLDu01z_sq-Qk,14646
@@ -44,7 +44,7 @@ lucidicai/telemetry/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
44
44
  lucidicai/telemetry/utils/image_storage.py,sha256=4Z59ZpVexr7-lcExfr8GsqXe0y2VZmr8Yjwa-3DeOxU,1457
45
45
  lucidicai/telemetry/utils/text_storage.py,sha256=L62MMJ8E23TDqDTUv2aRntdKMCItsXV7XjY6cFwx2DE,1503
46
46
  lucidicai/telemetry/utils/universal_image_interceptor.py,sha256=zPfVsMjtKxJP2n2OOjKbtPiQJTZ0sf5_28GWprOnJP4,12185
47
- lucidicai-1.2.20.dist-info/METADATA,sha256=vn20bB7YfIoEnDP-o_rATqNh2vDhvBORz5snd_0Sjxw,903
48
- lucidicai-1.2.20.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
49
- lucidicai-1.2.20.dist-info/top_level.txt,sha256=vSSdM3lclF4I5tyVC0xxUk8eIRnnYXMe1hW-eO91HUo,10
50
- lucidicai-1.2.20.dist-info/RECORD,,
47
+ lucidicai-1.2.21.dist-info/METADATA,sha256=J9vZ_O1IedeJFTUJu7VynU7-RgADkqXDLSIOE8r_Oms,903
48
+ lucidicai-1.2.21.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
49
+ lucidicai-1.2.21.dist-info/top_level.txt,sha256=vSSdM3lclF4I5tyVC0xxUk8eIRnnYXMe1hW-eO91HUo,10
50
+ lucidicai-1.2.21.dist-info/RECORD,,