Skip to content

Commit 1b36023

Browse files
ensure cycle dependencies are resolved
1 parent 5b70293 commit 1b36023

5 files changed

Lines changed: 33 additions & 16 deletions

File tree

libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/middleware/baggage_builder.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
)
3232
from ..models.operation_source import OperationSource
3333
from ..utils import deprecated, validate_and_normalize_ip
34-
from .turn_context_baggage import from_turn_context
3534

3635
logger = logging.getLogger(__name__)
3736

@@ -232,14 +231,6 @@ def channel_links(self, value: str | None) -> "BaggageBuilder":
232231
self._set(GEN_AI_EXECUTION_SOURCE_DESCRIPTION_KEY, value)
233232
return self
234233

235-
def from_turn_context(self, turn_context: Any) -> "BaggageBuilder":
236-
"""
237-
Populate baggage from a turn_context (duck-typed).
238-
Delegates to baggage_turn_context.from_turn_context.
239-
"""
240-
241-
return self.set_pairs(from_turn_context(turn_context))
242-
243234
def set_pairs(self, pairs: Any) -> "BaggageBuilder":
244235
"""
245236
Accept dict or iterable of (k,v).

libraries/microsoft-agents-a365-observability-hosting/microsoft_agents_a365/observability/hosting/scope_helpers/populate_baggage.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from typing import Any
55

66
from microsoft_agents.hosting.core.turn_context import TurnContext
7+
from microsoft_agents_a365.observability.core.middleware.baggage_builder import BaggageBuilder
78

89
from .utils import (
910
get_caller_pairs,
@@ -27,6 +28,15 @@ def _iter_all_pairs(turn_context: TurnContext) -> Iterator[tuple[str, Any]]:
2728
yield from get_conversation_pairs(activity)
2829

2930

30-
def from_turn_context(turn_context: TurnContext) -> dict:
31-
"""Populate builder with baggage values extracted from a turn context."""
32-
return dict(_iter_all_pairs(turn_context))
31+
def populate(builder: BaggageBuilder, turn_context: TurnContext) -> BaggageBuilder:
32+
"""Populate BaggageBuilder with baggage values extracted from a turn context.
33+
34+
Args:
35+
builder: The BaggageBuilder instance to populate
36+
turn_context: The TurnContext containing activity information
37+
38+
Returns:
39+
The updated BaggageBuilder instance (for method chaining)
40+
"""
41+
builder.set_pairs(_iter_all_pairs(turn_context))
42+
return builder

libraries/microsoft-agents-a365-observability-hosting/microsoft_agents_a365/observability/hosting/scope_helpers/populate_invoke_agent_scope.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
from microsoft_agents.hosting.core.turn_context import TurnContext
1818

1919

20-
def populate_invoke_agent_scope_from_turn_context(
21-
scope: InvokeAgentScope, turn_context: TurnContext
22-
) -> InvokeAgentScope:
20+
def populate(scope: InvokeAgentScope, turn_context: TurnContext) -> InvokeAgentScope:
2321
"""
2422
Populate all supported InvokeAgentScope tags from the provided TurnContext.
2523
:param scope: The InvokeAgentScope instance to populate.

libraries/microsoft-agents-a365-observability-hosting/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
# - Internal packages get: >= current_base_version (e.g., >= 0.1.0)
2121
# - Automatically updates when you build new versions
2222
dynamic_install_requires = get_dynamic_dependencies(
23-
Path(__file__).parent, version_strategy="minimum"
23+
use_compatible_release=False, # No upper bound
24+
use_exact_match=False, # Not exact match
2425
)
2526

2627
setup(

uv.lock

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)