Skip to content
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

LMPs return a 3-tuple when exempt_from_tracking=True #394

Open
jwang-paradise opened this issue Nov 28, 2024 · 1 comment
Open

LMPs return a 3-tuple when exempt_from_tracking=True #394

jwang-paradise opened this issue Nov 28, 2024 · 1 comment

Comments

@jwang-paradise
Copy link
Contributor

LMPs registered with @ell.simple/complex/tool return different shapes with different exempt_from_tracking settings.

For example, when exempt_from_tracking=False, LMP returns a message as expected:

@ell.complex(...)
def complex_lmp(message_history: list[Message]) -> list[Message]: ...

resp_message = complex_lmp(message_history)

But when exempt_from_tracking=True, LMP returns a 3 tuple:

@ell.complex(..., exempt_from_tracking=True)
def complex_lmp_EXEMPTED(message_history: list[Message]) -> list[Message]: ...

resp_message, final_call_params, api_metadata = complex_lmp_EXEMPTED(message_history)
# unexpectedly got a 3 tuple

The docs should really mention this weird side effect. Took me quite a while to figure it out.

@jwang-paradise
Copy link
Contributor Author

jwang-paradise commented Nov 28, 2024

An LMP tool @ell.tool(exempt_from_tracking=True) will also return a 3-tuple, causing ValidationError in ToolCall.call_and_collect_as_content_block method: message.py

ValidationError: 1 validation error for ContentBlock tool_result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant