|
7 | 7 | """ |
8 | 8 |
|
9 | 9 | from contextlib import contextmanager |
10 | | -from typing import ContextManager, Optional, Dict, Any |
| 10 | +from typing import Optional, Dict, Any |
11 | 11 |
|
12 | 12 | from opentelemetry import trace |
13 | 13 | from opentelemetry.trace import Status, StatusCode, Span |
@@ -130,7 +130,7 @@ def chat_span( |
130 | 130 | conversation_id: Optional[str] = None, |
131 | 131 | server_address: Optional[str] = None, |
132 | 132 | attributes: Optional[Dict[str, Any]] = None, |
133 | | -) -> ContextManager[Span]: |
| 133 | +): |
134 | 134 | """ |
135 | 135 | Create a span for LLM chat/completion API calls (OpenTelemetry GenAI Inference span). |
136 | 136 |
|
@@ -209,7 +209,7 @@ def execute_tool_span( |
209 | 209 | tool_type: Optional[str] = None, |
210 | 210 | tool_description: Optional[str] = None, |
211 | 211 | attributes: Optional[Dict[str, Any]] = None, |
212 | | -) -> ContextManager[Span]: |
| 212 | +): |
213 | 213 | """ |
214 | 214 | Create a span for tool execution in agentic workflows (OpenTelemetry GenAI Execute Tool span). |
215 | 215 |
|
@@ -277,7 +277,7 @@ def invoke_agent_span( |
277 | 277 | server_address: Optional[str] = None, |
278 | 278 | kind: trace.SpanKind = trace.SpanKind.CLIENT, |
279 | 279 | attributes: Optional[Dict[str, Any]] = None, |
280 | | -) -> ContextManager[Span]: |
| 280 | +): |
281 | 281 | """ |
282 | 282 | Create a span for GenAI agent invocation (OpenTelemetry GenAI Invoke agent span). |
283 | 283 |
|
|
0 commit comments