openinference-instrumentation-beeai 0.1.12__py3-none-any.whl → 0.1.14__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.
@@ -18,6 +18,9 @@ from openinference.semconv.trace import (
18
18
  class Processor:
19
19
  kind: ClassVar[OpenInferenceSpanKindValues] = OpenInferenceSpanKindValues.UNKNOWN
20
20
 
21
+ def get_span_name(self, target_cls: type) -> str:
22
+ return target_cls.__name__
23
+
21
24
  def __init__(self, event: "RunContextStartEvent", meta: "EventMeta"):
22
25
  from beeai_framework.context import RunContext
23
26
 
@@ -27,7 +30,7 @@ class Processor:
27
30
  assert meta.trace is not None
28
31
  self.run_id = meta.trace.run_id
29
32
 
30
- self.span = SpanWrapper(name=target_cls.__name__, kind=type(self).kind)
33
+ self.span = SpanWrapper(name=self.get_span_name(target_cls), kind=type(self).kind)
31
34
  self.span.started_at = meta.created_at
32
35
  self.span.attributes.update(
33
36
  {
@@ -12,6 +12,7 @@ from beeai_framework.backend.events import (
12
12
  from beeai_framework.context import RunContext
13
13
  from typing_extensions import override
14
14
 
15
+ from openinference.instrumentation import safe_json_dumps
15
16
  from openinference.instrumentation.beeai.processors.base import Processor
16
17
  from openinference.semconv.trace import (
17
18
  EmbeddingAttributes,
@@ -23,6 +24,10 @@ from openinference.semconv.trace import (
23
24
  class EmbeddingModelProcessor(Processor):
24
25
  kind: ClassVar[OpenInferenceSpanKindValues] = OpenInferenceSpanKindValues.EMBEDDING
25
26
 
27
+ @override
28
+ def get_span_name(self, target_cls: type) -> str:
29
+ return "CreateEmbeddings"
30
+
26
31
  def __init__(self, event: "RunContextStartEvent", meta: "EventMeta"):
27
32
  super().__init__(event, meta)
28
33
 
@@ -33,10 +38,22 @@ class EmbeddingModelProcessor(Processor):
33
38
  self.span.set_attributes(
34
39
  {
35
40
  SpanAttributes.EMBEDDING_MODEL_NAME: llm.model_id,
36
- SpanAttributes.LLM_PROVIDER: llm.provider_id,
37
41
  }
38
42
  )
39
43
 
44
+ # Extract invocation parameters (exclude input values)
45
+ if hasattr(event, "input") and hasattr(event.input, "__dict__"):
46
+ invocation_params = {
47
+ k: v
48
+ for k, v in event.input.__dict__.items()
49
+ if k not in {"values", "api_key", "token"} and not k.startswith("_")
50
+ }
51
+ if invocation_params:
52
+ self.span.set_attribute(
53
+ SpanAttributes.EMBEDDING_INVOCATION_PARAMETERS,
54
+ safe_json_dumps(invocation_params),
55
+ )
56
+
40
57
  @override
41
58
  async def update(
42
59
  self,
@@ -56,9 +73,10 @@ class EmbeddingModelProcessor(Processor):
56
73
  )
57
74
  elif isinstance(event, EmbeddingModelSuccessEvent):
58
75
  for idx, embedding in enumerate(event.value.embeddings):
76
+ vector = list(embedding) if not isinstance(embedding, list) else embedding
59
77
  self.span.set_attribute(
60
78
  f"{SpanAttributes.EMBEDDING_EMBEDDINGS}.{idx}.{EmbeddingAttributes.EMBEDDING_VECTOR}",
61
- embedding,
79
+ vector,
62
80
  )
63
81
 
64
82
  if event.value.usage:
@@ -1 +1 @@
1
- __version__ = "0.1.12"
1
+ __version__ = "0.1.14"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openinference-instrumentation-beeai
3
- Version: 0.1.12
3
+ Version: 0.1.14
4
4
  Summary: OpenInference BeeAI Instrumentation
5
5
  Project-URL: Homepage, https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-beeai
6
6
  Author: IBM Corp.
@@ -14,10 +14,11 @@ Classifier: Programming Language :: Python :: 3
14
14
  Classifier: Programming Language :: Python :: 3.11
15
15
  Classifier: Programming Language :: Python :: 3.12
16
16
  Classifier: Programming Language :: Python :: 3.13
17
- Requires-Python: <3.14,>=3.11
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Requires-Python: <3.15,>=3.11
18
19
  Requires-Dist: beeai-framework<0.2.0,>=0.1.51
19
20
  Requires-Dist: openinference-instrumentation>=0.1.37
20
- Requires-Dist: openinference-semantic-conventions>=0.1.21
21
+ Requires-Dist: openinference-semantic-conventions>=0.1.25
21
22
  Requires-Dist: opentelemetry-api>=1.36.0
22
23
  Requires-Dist: opentelemetry-instrumentation>=0.57b0
23
24
  Requires-Dist: opentelemetry-semantic-conventions>=0.57b0
@@ -1,11 +1,11 @@
1
1
  openinference/instrumentation/beeai/__init__.py,sha256=OVys0Yf0LCB76P_YvnJp9Ph7J746ZPC8r8qYe3REeYE,5229
2
2
  openinference/instrumentation/beeai/_span.py,sha256=iVlYou4vnNKtDxpypMdZuD2AKeaDiG1Cu5PXVzgQ8w4,3259
3
3
  openinference/instrumentation/beeai/_utils.py,sha256=tfQsQEcevyLJno8WmLTOe936GVTIS2etnAFVbAPyztc,2521
4
- openinference/instrumentation/beeai/version.py,sha256=LcIlFjHZFfiF9Rd4UHoakmombOFkxIYk00I181frGBM,23
4
+ openinference/instrumentation/beeai/version.py,sha256=PIBqEOI-nqKFL9oJAWQQwlHuujG9Cd7EmdxDrThNQto,23
5
5
  openinference/instrumentation/beeai/processors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- openinference/instrumentation/beeai/processors/base.py,sha256=-h8tx1moKVi-1t3RpN-c7klGRJyHwoYe16rKWcZ_bhs,2204
6
+ openinference/instrumentation/beeai/processors/base.py,sha256=KyS524sQ5NMXH7HxHGdGiqEofLPHulMG6EURz3ab134,2305
7
7
  openinference/instrumentation/beeai/processors/chat.py,sha256=Nl0JWThA7f7Oeet6136fARdpNmakMH0SYym3T9kCGFg,9281
8
- openinference/instrumentation/beeai/processors/embedding.py,sha256=T9fZs2M7qEs4SnLYbSXRbhe3P7rCNch-snRQBDSC9Es,2598
8
+ openinference/instrumentation/beeai/processors/embedding.py,sha256=Vzk-XhQ7cwVwkhjfa92iQ8_qs54rtlkVgFNwgQzPs_M,3350
9
9
  openinference/instrumentation/beeai/processors/locator.py,sha256=oleg8Jxg8sJBIzK4cZ7BbfkHuLH9Hu4XRYqDaOGnNBU,3627
10
10
  openinference/instrumentation/beeai/processors/requirement.py,sha256=S5OPN6F5V39puumxEo3fKQRoAOZ_8OC5ml0dr_Z9v0U,2662
11
11
  openinference/instrumentation/beeai/processors/tool.py,sha256=o5aKAqEHZIk9bmK2rWUqtACiyMltIFCnzaunCKxRtu8,2765
@@ -15,7 +15,7 @@ openinference/instrumentation/beeai/processors/agents/base.py,sha256=3fidrUoU9pV
15
15
  openinference/instrumentation/beeai/processors/agents/react.py,sha256=rS3xlvgyZ5G6MyDMeSh4xFLT_66h7GVAYEYlwZCpIdY,3022
16
16
  openinference/instrumentation/beeai/processors/agents/requirement_agent.py,sha256=eEiEls6vUET-gEMor1FDyzOpgXCAZVQ3gugSaK3hOHA,2772
17
17
  openinference/instrumentation/beeai/processors/agents/tool_calling.py,sha256=yaWP5JmGuvZIha9iUSKgv0MJgI0QSbuiJLLQFnbqUZw,1223
18
- openinference_instrumentation_beeai-0.1.12.dist-info/METADATA,sha256=YXnEboNDscHrxTZZBkITmi5F1aGh4CXolz3HMwwW15o,5492
19
- openinference_instrumentation_beeai-0.1.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
20
- openinference_instrumentation_beeai-0.1.12.dist-info/entry_points.txt,sha256=ee7EUhbWv-XK1dxhPXuFVy9qstzj-lc-265Phe2Ml9s,183
21
- openinference_instrumentation_beeai-0.1.12.dist-info/RECORD,,
18
+ openinference_instrumentation_beeai-0.1.14.dist-info/METADATA,sha256=YrO30Bkk1Wh_PLCDruC_Al1MSQ0yosi6bb1mMHFvvU0,5543
19
+ openinference_instrumentation_beeai-0.1.14.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
20
+ openinference_instrumentation_beeai-0.1.14.dist-info/entry_points.txt,sha256=ee7EUhbWv-XK1dxhPXuFVy9qstzj-lc-265Phe2Ml9s,183
21
+ openinference_instrumentation_beeai-0.1.14.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
2
+ Generator: hatchling 1.28.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any