log_outputs#

langsmith.testing._internal.log_outputs(outputs: dict, /) None[source]#

记录 pytest 测试运行中的运行输出。

警告

此 API 处于 Beta 阶段,未来版本可能会更改。

应该只在用 @pytest.mark.langsmith 装饰的 pytest 测试中使用。

参数:

outputs (dict) – 要记录的输出。

返回类型:

None

示例

from langsmith import testing as t


@pytest.mark.langsmith
def test_foo() -> None:
    x = 0
    y = 1
    result = foo(x, y)
    t.log_outputs({"foo": result})
    assert result == 2