fix(litellm): map async call types to the right telemetry endpoint - #273
Merged
Conversation
LiteLLM's CallTypes name the calling function, not the wire endpoint: ``completion``/``acompletion`` is the chat API and ``text_completion``/``atext_completion`` is the legacy one. The path mapping matched only the bare stems and put ``completion`` on the legacy side, so both async spellings landed in the wrong bucket. Under the proxy every call is the async variant, which meant every /v1/completions request was reported to Token Spy as /v1/chat/completions. The ``responses`` branch already used a substring test and was unaffected. Match the text_completion family explicitly and let everything else fall through to chat, so sync and async spellings agree.
# Conflicts: # ods/extensions/services/litellm/tests/test_token_spy_callback.py
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.
Ports upstream Osmantic#2086: fix(litellm): map async call types to the right telemetry endpoint
Original: Osmantic#2086
Retry pass: conflicted with an earlier port from this run; hunks were disjoint so both were unioned. Lint/structural/legacy-token checked.