Skip to content

Commit 5f8deb9

Browse files
committed
linting
1 parent bd4cff8 commit 5f8deb9

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

agentops/instrumentation/providers/openai/stream_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from typing import Any, AsyncIterator, Iterator
1010

1111
from opentelemetry import context as context_api
12-
from opentelemetry.trace import Span, SpanKind, Status, StatusCode, set_span_in_context, get_tracer
12+
from opentelemetry.trace import Span, SpanKind, Status, StatusCode, set_span_in_context
1313
from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
1414

1515
from agentops.logging import logger

agentops/instrumentation/providers/openai/wrappers/chat.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from agentops.semconv.tool import ToolAttributes
2121
from agentops.semconv.span_kinds import AgentOpsSpanKindValues
2222

23-
from opentelemetry.trace import SpanKind, Status, StatusCode, get_tracer, set_span_in_context, get_current
23+
from opentelemetry.trace import SpanKind, get_tracer, set_span_in_context, get_current
2424

2525
logger = logging.getLogger(__name__)
2626

@@ -30,28 +30,28 @@
3030
def _create_tool_span(parent_span: Span, tool_call_data: Dict[str, Any]):
3131
"""
3232
Create a distinct span for each tool call.
33-
33+
3434
Args:
3535
parent_span: The parent LLM span
3636
tool_call_data: The tool call data dictionary
3737
"""
3838
# Get the tracer for this module
3939
tracer = get_tracer(__name__)
40-
40+
4141
# Create a child span for the tool call
4242
with tracer.start_as_current_span(
4343
name=f"tool_call.{tool_call_data['function']['name']}",
4444
kind=SpanKind.INTERNAL,
45-
context=set_span_in_context(parent_span, get_current())
45+
context=set_span_in_context(parent_span, get_current()),
4646
) as tool_span:
4747
# Set the span kind to TOOL
4848
tool_span.set_attribute("agentops.span.kind", AgentOpsSpanKindValues.TOOL)
49-
49+
5050
# Set tool-specific attributes
51-
tool_span.set_attribute(ToolAttributes.TOOL_NAME, tool_call_data['function']['name'])
52-
tool_span.set_attribute(ToolAttributes.TOOL_PARAMETERS, tool_call_data['function']['arguments'])
53-
tool_span.set_attribute("tool.call.id", tool_call_data['id'])
54-
tool_span.set_attribute("tool.call.type", tool_call_data['type'])
51+
tool_span.set_attribute(ToolAttributes.TOOL_NAME, tool_call_data["function"]["name"])
52+
tool_span.set_attribute(ToolAttributes.TOOL_PARAMETERS, tool_call_data["function"]["arguments"])
53+
tool_span.set_attribute("tool.call.id", tool_call_data["id"])
54+
tool_span.set_attribute("tool.call.type", tool_call_data["type"])
5555

5656

5757
def handle_chat_attributes(
@@ -64,7 +64,7 @@ def handle_chat_attributes(
6464
6565
This function is designed to work with the common wrapper pattern,
6666
extracting attributes from the method arguments and return value.
67-
67+
6868
Args:
6969
args: Method arguments (not used in this implementation)
7070
kwargs: Method keyword arguments
@@ -240,8 +240,8 @@ def handle_chat_attributes(
240240
"type": tool_call.get("type", "function"),
241241
"function": {
242242
"name": function.get("name", ""),
243-
"arguments": function.get("arguments", "")
244-
}
243+
"arguments": function.get("arguments", ""),
244+
},
245245
}
246246
# Create a child span for this tool call
247247
_create_tool_span(span, tool_call_data)

0 commit comments

Comments
 (0)