langsmith-sdk icon indicating copy to clipboard operation
langsmith-sdk copied to clipboard

Issue: Evaluation runs ignore child traces

Open jennmueng opened this issue 1 year ago • 4 comments

Issue you'd like to raise.

We're running evaluations on a pipeline that we've already instrumented with @traceable, when those evaluations run the trace shows up fine in the normal project view: https://smith.langchain.com/public/1480ce7d-103e-426c-b416-cef4b9c670ac/r

However, in the evaluation run's trace it's empty: https://smith.langchain.com/public/37a27aba-ea90-4184-9686-01e302b4de6f/r

Suggestion:

Have the fully instrumented pipeline we have show up in the evaluation run so it's easier to review + show token count

jennmueng avatar Mar 25 '24 16:03 jennmueng

Ah yes the handoff back to langsmith from langchain code still is manual, and the evaluation runner currently is instrumented using langchain code - I have a ticket to fix this. Does the following work for now?

from langsmith.run_helpers import as_runnable

@traceable
def my_pipeline(....):
     return ....

def predict_result(inputs: dict):
    return as_runnable(my_pipeline).invoke(inputs)


run_on_dataset(llm_or_chain_factory=predict_result, ...)

hinthornw avatar Mar 26 '24 00:03 hinthornw

@hinthornw nope, getting a wrap_traceable item with no children: Screenshot 2024-03-26 at 1 34 15 PM

jennmueng avatar Mar 26 '24 20:03 jennmueng

I'm running into a similar issue when running the official Evaluation Quick Start example. I can see the llm child_run in the json, but its not visualised. Is this the same bug or different?

peterjrichens avatar Apr 27 '24 08:04 peterjrichens

same here, 10 ish runs in a trace, but only two displayed

image image image

eltonio450 avatar Jul 31 '24 14:07 eltonio450

Closing as stale

hinthornw avatar Sep 06 '24 23:09 hinthornw