Fix tracer missing triplets from LangChain with_structured_output#484
Open
Mr-Neutr0n wants to merge 1 commit intomicrosoft:mainfrom
Open
Fix tracer missing triplets from LangChain with_structured_output#484Mr-Neutr0n wants to merge 1 commit intomicrosoft:mainfrom
Mr-Neutr0n wants to merge 1 commit intomicrosoft:mainfrom
Conversation
…_output The default llm_call_match regex in TracerTraceToTriplet and TraceTree.to_trajectory only matched "openai.chat.completion" spans. LangChain's with_structured_output() produces spans named "chat_model.llm" instead, causing the tracer to miss them entirely and produce zero triplets. Expand the default pattern to also match "chat_model.llm" spans. Fixes microsoft#308
Author
|
Friendly bump! Let me know if there's anything I should update or improve to help move this forward. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
llm_call_matchregex pattern inTracerTraceToTripletandTraceTree.to_trajectory()to also match"chat_model.llm"spans produced by LangChain'swith_structured_output()."openai.chat.completion"spans were matched, causing zero triplets to be captured when using structured output.chat_model.llmspans are correctly matched and converted into triplets.Fixes #308
Test plan
test_triplet_trace_tree.py)test_tracer_trace_to_triplet_matches_chat_model_llm_spansvalidates the fixwith_structured_output()