log_reference_outputs#

langsmith.testing._internal.log_reference_outputs(reference_outputs: dict, /) None[source]#

从 pytest 测试运行中记录示例参考输出。

警告

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

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

参数:
  • outputs – 要记录的参考输出。

  • reference_outputs (dict)

返回类型:

None

示例

from langsmith import testing


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