Wraps a 2-arg [BiFunction] with LangSmith tracing.
public BiFunction<
I1,
I2,
O
> traceBiFunction(BiFunction<I1, I2, O> block, TraceConfig config)Wraps a 2-arg [BiFunction] with LangSmith tracing. This is the recommended entry point for Java callers (2-arg). It avoids the overload-resolution ambiguity that can occur with [traceable] when Kotlin function types are on the classpath. Kotlin callers should prefer [traceable] directly.
TraceConfig config = TraceConfig.builder()
.name("combine")
.client(LangsmithOkHttpClient.fromEnv())
.build();
BiFunction traced =
Tracing.traceBiFunction((a, b) -> a + " " + b, config);
String result = traced.apply("hello", "world");| Name | Type | Description |
|---|---|---|
block* | BiFunction<I1, I2, O> | |
config* | TraceConfig |