Skip to content

Commit 7c0e8bf

Browse files
committed
Fixed ruff errors and renamed method
1 parent 8310831 commit 7c0e8bf

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

instrumentation-genai/opentelemetry-instrumentation-langchain/src/opentelemetry/instrumentation/langchain/callback_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(
4646
def on_chat_model_start(
4747
self,
4848
serialized: dict[str, Any],
49-
messages: List[List[BaseMessage]], # type: ignore
49+
messages: list[list[BaseMessage]], # type: ignore
5050
*,
5151
run_id: UUID,
5252
tags: list[str] | None,

instrumentation-genai/opentelemetry-instrumentation-langchain/src/opentelemetry/instrumentation/langchain/span_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def _create_span(
7070

7171
return span
7272

73-
def create_llm_span(
73+
def create_chat_span(
7474
self,
7575
run_id: UUID,
7676
parent_run_id: Optional[UUID],

instrumentation-genai/opentelemetry-instrumentation-langchain/tests/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
InMemorySpanExporter,
1515
)
1616

17+
1718
@pytest.fixture(scope="function", name="llm_model")
1819
def fixture_llm_model():
1920
llm = ChatOpenAI(
@@ -28,6 +29,7 @@ def fixture_llm_model():
2829
)
2930
yield llm
3031

32+
3133
@pytest.fixture(scope="function", name="span_exporter")
3234
def fixture_span_exporter():
3335
exporter = InMemorySpanExporter()

instrumentation-genai/opentelemetry-instrumentation-langchain/tests/test_llm_call.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@
22

33
import pytest
44
from langchain_core.messages import HumanMessage, SystemMessage
5-
from langchain_openai import ChatOpenAI
65

76
from opentelemetry.sdk.trace import ReadableSpan
87
from opentelemetry.semconv._incubating.attributes import gen_ai_attributes
98

109

1110
# span_exporter, start_instrumentation, llm_model are coming from fixtures defined in conftest.py
1211
@pytest.mark.vcr()
13-
def test_langchain_call(
14-
span_exporter, start_instrumentation, llm_model
15-
):
16-
12+
def test_langchain_call(span_exporter, start_instrumentation, llm_model):
1713
messages = [
1814
SystemMessage(content="You are a helpful assistant!"),
1915
HumanMessage(content="What is the capital of France?"),

0 commit comments

Comments
 (0)