-
Notifications
You must be signed in to change notification settings - Fork 3
Enable evals with traceloop translate #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Deplpyment scripts - env files - requirements.txt These are for traceloop translator and apps to run
|
|
||
| # Add test marker to verify lifecycle integrity | ||
| invocation.attributes["test.synthetic_span_marker"] = "created_in_start_llm" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left over from testing. Fixed
| try: | ||
| from langchain_core.messages import ( | ||
| BaseMessage, | ||
| HumanMessage, | ||
| AIMessage, | ||
| SystemMessage, | ||
| ToolMessage, | ||
| FunctionMessage, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we explicitly trying to import langchain library classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used to create the actual langchain specific object when reconstructing the input and output messages like HumanMessage and others
| "LangChain not available; message reconstruction skipped. " | ||
| "Install langchain-core to enable evaluations with Traceloop." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, we need to update this msg
| def _convert_normalized_to_langchain( | ||
| normalized_messages: List[Dict[str, Any]], | ||
| direction: str | ||
| ) -> List[Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could probably verify if the installed library is langchain and then execute this method, right? else we need to make it more general
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point but for now let's keep it langchain specific. Otherwise we'll need to verify with the other library. We can add as we go.
| input_messages=input_messages or [], | ||
| output_messages=output_messages or [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this parameters be okay if there are no evals in the pipeline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's okay to have it as it'll be empty, [], and evals library will take care of it
| # NOW mark the original span as processed (AFTER translation is done) | ||
| # This prevents infinite recursion while allowing synthetic span creation | ||
| if hasattr(span, "_attributes"): | ||
| span._attributes["_traceloop_processed"] = True # type: ignore[attr-defined] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@91pavan I have moved the marking to this line outside _mutate_span_if_needed and _process_span_translation so can leave the checks inside those methods but the start_llm() and stop_llm() will also get triggered
input/put messagewhen callinginvocationfrom traceloop translatortraceloop.entity.input/outputto the formatdeepevalexpects