fix(tracing): separate request and response LLM models#4018
Open
oWretch wants to merge 2 commits intopipecat-ai:mainfrom
Open
fix(tracing): separate request and response LLM models#4018oWretch wants to merge 2 commits intopipecat-ai:mainfrom
oWretch wants to merge 2 commits intopipecat-ai:mainfrom
Conversation
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
gen_ai.request.modelstable to configured/requested model valuesgen_ai.response.modelsupport in shared LLM span attributeschangelog/4018.fixed.mdProblem This Fix Addresses
Today, multi-turn conversations can show inconsistent model attribution in traces:
gen_ai.request.modelis typically the configured deployment/model name (for examplegpt-4o)gen_ai.request.modelcan drift to the resolved response model version from a prior call (for examplegpt-4o-2024-11-20)gen_ai.response.modelmay be missing entirelyThis makes trace analysis confusing because the request model appears to change across turns even though the configured request model is the same.
Behavior After This Change
gen_ai.request.modelremains consistent across calls and reflects the requested/configured modelgen_ai.response.modelis populated when provider response data arrives, so resolved model versions are captured in the correct attributeIn other words, request-model attribution is now stable across the first and subsequent calls, and response-model attribution is now explicit and accurate.
Validation