fix: ensure consistent return value with exempt_from_tracking=True#443
Open
majiayu000 wants to merge 1 commit intoMadcowD:mainfrom
Open
fix: ensure consistent return value with exempt_from_tracking=True#443majiayu000 wants to merge 1 commit intoMadcowD:mainfrom
majiayu000 wants to merge 1 commit intoMadcowD:mainfrom
Conversation
When exempt_from_tracking=True, LMPs (@ell.simple, @ell.complex, @ell.tool, @ell.function) were returning a 3-tuple (result, api_params, metadata) instead of just the result. This was inconsistent with the behavior when exempt_from_tracking=False. This fix wraps the internal function with an exempt_wrapper that extracts only the result from the 3-tuple, ensuring consistent return behavior regardless of the exempt_from_tracking setting. Fixes MadcowD#394 Signed-off-by: majiayu000 <1835304752@qq.com>
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
exempt_from_tracking=True@ell.simple,@ell.complex,@ell.tool,@ell.function) were returning a 3-tuple instead of just the resultChanges
src/ell/lmp/complex.py: Addedexempt_wrapperthat extracts result from 3-tuplesrc/ell/lmp/tool.py: Addedexempt_wrapperfor toolssrc/ell/lmp/function.py: Addedexempt_wrapperfor functionstests/test_exempt_from_tracking.py: Added comprehensive testsTest plan
Fixes #394