langchain
a27fa9bf - Use traceable context (#11896)

Commit
2 years ago
Use traceable context (#11896) Example ``` from langchain.schema.runnable import RunnableLambda from langsmith import traceable chain = RunnableLambda(lambda x: x) @traceable(run_type = "chain") def my_traceable(a): chain.invoke(a) my_traceable(5) ``` Would have a nested result. This would NOT work for interleaving chains and traceables. E.g., things like thiswould still not work well ``` from langchain.schema.runnable import RunnableLambda from langsmith import traceable @traceable() def other_traceable(a): return a def foo(x): return other_traceable(x) chain = RunnableLambda(foo) @traceable(run_type = "chain") def my_traceable(a): chain.invoke(a) my_traceable(5) ```
Author
Parents
Loading