Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tests/test_langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_callback_generated_from_trace_chat():

assert trace.id == trace_id

assert len(trace.observations) == 2
assert len(trace.observations) == 3

langchain_generation_span = list(
filter(
Expand Down Expand Up @@ -286,7 +286,7 @@ def test_openai_instruct_usage():
observations = get_api().trace.get(trace_id).observations

# Add 1 to account for the wrapping span
assert len(observations) == 3
assert len(observations) == 4

for observation in observations:
if observation.type == "GENERATION":
Expand Down Expand Up @@ -463,7 +463,7 @@ def test_link_langfuse_prompts_invoke():
key=lambda x: x.start_time,
)

assert len(generations) == 2
assert len(generations) == 4
assert generations[0].input == "Tell me a joke involving the animal dog"
assert "Explain the joke to me like I'm a 5 year old" in generations[1].input

Comment thread
hassiebp marked this conversation as resolved.
Expand Down Expand Up @@ -550,7 +550,7 @@ def test_link_langfuse_prompts_stream():
key=lambda x: x.start_time,
)

assert len(generations) == 2
assert len(generations) == 4
assert generations[0].input == "Tell me a joke involving the animal dog"
assert "Explain the joke to me like I'm a 5 year old" in generations[1].input

Expand Down Expand Up @@ -639,7 +639,7 @@ def test_link_langfuse_prompts_batch():
key=lambda x: x.start_time,
)

assert len(generations) == 6
assert len(generations) == 10
Comment thread
hassiebp marked this conversation as resolved.

assert generations[0].prompt_name == joke_prompt_name
assert generations[1].prompt_name == joke_prompt_name
Expand Down Expand Up @@ -856,7 +856,7 @@ def test_multimodal():

trace = get_api().trace.get(trace_id=trace_id)

assert len(trace.observations) == 2
assert len(trace.observations) == 3
# Filter for the observation with type GENERATION
generation_observation = next(
(obs for obs in trace.observations if obs.type == "GENERATION"), None
Expand Down
Loading