log_inputs#

langsmith.testing._internal.log_inputs(inputs: dict, /) None[source]#

从 pytest 测试运行中记录运行输入。

警告

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

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

参数:

inputs (dict) – 要记录的输入。

返回类型:

None

示例

from langsmith import testing as t


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