by-framework-langgraph 0.0.3.dev2__py3-none-any.whl → 0.0.3.dev3__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.
@@ -525,6 +525,7 @@ class LangGraphAdapter:
525
525
  self._context, "parent_message_id", ""
526
526
  ),
527
527
  "by_framework_agent_id": getattr(self._context, "current_agent_id", ""),
528
+ "worker_id": getattr(self._context, "worker_id", ""),
528
529
  "langgraph_thread_id": self._thread_id,
529
530
  }
530
531
  return {
@@ -538,10 +539,31 @@ class LangGraphAdapter:
538
539
 
539
540
  with (
540
541
  self._phoenix_context_manager(),
542
+ self._langfuse_attribute_propagation_context_manager(),
541
543
  self._langfuse_callback_manager(callbacks),
542
544
  ):
543
545
  yield callbacks
544
546
 
547
+ @contextmanager
548
+ def _langfuse_attribute_propagation_context_manager(self) -> Iterator[None]:
549
+ """Propagate stable framework metadata to Langfuse child observations."""
550
+ worker_id = str(getattr(self._context, "worker_id", "") or "")
551
+ if not worker_id:
552
+ yield
553
+ return
554
+
555
+ try:
556
+ propagate_attributes = getattr(
557
+ import_module("langfuse"),
558
+ "propagate_attributes",
559
+ )
560
+ except (ImportError, AttributeError):
561
+ yield
562
+ return
563
+
564
+ with propagate_attributes(metadata={"worker_id": worker_id}):
565
+ yield
566
+
545
567
  @contextmanager
546
568
  def _phoenix_context_manager(self) -> Iterator[None]:
547
569
  """Prepare OpenTelemetry context for Phoenix tracing."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: by-framework-langgraph
3
- Version: 0.0.3.dev2
3
+ Version: 0.0.3.dev3
4
4
  Summary: LangGraph integration for by-framework
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: by-framework>=0.2.1
@@ -1,8 +1,8 @@
1
1
  by_framework_langgraph/__init__.py,sha256=x08wIaK4VRnUnUD_mbBxVgI2Zf7CvwAVbr3syP2NQps,1046
2
2
  by_framework_langgraph/_utils.py,sha256=A8eQ19YqyBiMKcPIlzmwggN_mK5iQvNJPTaTmsywWsw,1605
3
- by_framework_langgraph/adapter.py,sha256=b4WcK6R3B0Y7a52lIY6kMLtpp9mjXOkp4p6HcALAzbA,26689
3
+ by_framework_langgraph/adapter.py,sha256=7b-3veBqOPP2frpGWELiSCrfPg4EeCZOdfNLN_nsFB0,27468
4
4
  by_framework_langgraph/tools.py,sha256=l7LurtKKXA1Z4fyj15ffFWyWpt8drNCJ-mkGmlS7EVo,5561
5
5
  by_framework_langgraph/worker.py,sha256=wFalpBQLqFm-YzJugzAzkA3ciI9lUzxRTv4GmqVCv78,6156
6
- by_framework_langgraph-0.0.3.dev2.dist-info/METADATA,sha256=lzuVDa2l8CUp_af7-VnadrCq-wJgXCWJ2ldcuEwHKRw,2334
7
- by_framework_langgraph-0.0.3.dev2.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
8
- by_framework_langgraph-0.0.3.dev2.dist-info/RECORD,,
6
+ by_framework_langgraph-0.0.3.dev3.dist-info/METADATA,sha256=iN1sV32D2M5ydKW4ByHFnYiA3jYBVVSHNQQDG1Wcabo,2334
7
+ by_framework_langgraph-0.0.3.dev3.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
8
+ by_framework_langgraph-0.0.3.dev3.dist-info/RECORD,,