log_outputs#

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

在 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