We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c18014 commit 2fd6b28Copy full SHA for 2fd6b28
1 file changed
util/opentelemetry-util-genai/src/opentelemetry/util/genai/handler.py
@@ -304,9 +304,7 @@ def fail_llm(
304
return self._fail(invocation, error)
305
306
@contextmanager
307
- def tool_call(
308
- self, tool_call: ToolCall | None = None
309
- ) -> Iterator[ToolCall]:
+ def tool_call(self, tool_call: ToolCall) -> Iterator[ToolCall]:
310
"""Context manager for tool call invocations.
311
312
Only set data attributes on the tool_call object, do not modify the span or context.
@@ -320,12 +318,6 @@ def tool_call(
320
318
# Execute tool logic
321
319
tc.tool_result = {"temp": 20, "condition": "sunny"}
322
"""
323
- if tool_call is None:
324
- tool_call = ToolCall(
325
- name="",
326
- arguments={},
327
- id=None,
328
- )
329
self.start(tool_call)
330
try:
331
yield tool_call
0 commit comments