Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw committed Dec 1, 2023
1 parent e07a28c commit e2b7ed8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion libs/core/langchain_core/tracers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def _get_stacktrace(error: BaseException) -> str:
tb = traceback.format_exception(error)
return msg + "\n\n".join(tb).strip()
except: # noqa: E722
breakpoint()
return msg

def _start_trace(self, run: Run) -> None:
Expand Down
4 changes: 2 additions & 2 deletions libs/core/tests/unit_tests/runnables/test_runnable.py
Original file line number Diff line number Diff line change
Expand Up @@ -3938,7 +3938,7 @@ def raise_value_error(x: int) -> int:
branch.invoke(1000, config={"callbacks": [tracer]})

assert len(tracer.runs) == 2
assert "ValueError('x is too large')" in tracer.runs[1].error
assert "ValueError('x is too large')" in str(tracer.runs[1].error)
assert tracer.runs[1].outputs is None


Expand All @@ -3965,7 +3965,7 @@ async def raise_value_error(x: int) -> int:
await branch.ainvoke(1000, config={"callbacks": [tracer]})

assert len(tracer.runs) == 2
assert "ValueError('x is too large')" in tracer.runs[1].error
assert "ValueError('x is too large')" in str(tracer.runs[1].error)
assert tracer.runs[1].outputs is None


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,13 @@ def test_tracer_llm_run_on_error() -> None:

tracer.on_llm_start(serialized=SERIALIZED, prompts=[], run_id=uuid)
tracer.on_llm_error(exception, run_id=uuid)
assert tracer.runs == [compare_run]
assert len(tracer.runs) == 1
received = tracer.runs[0].dict()
received_err = received.pop("error")
expected = compare_run.dict()
expected_err = expected.pop("error")
assert received == expected
assert expected_err in received_err


@freeze_time("2023-01-01")
Expand Down

0 comments on commit e2b7ed8

Please sign in to comment.