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

decorator of decorator that turns a list of decorators into a single decorator #661

Open
CharlesFarhat opened this issue Nov 1, 2024 · 0 comments
Labels
Feature Request New feature or request

Comments

@CharlesFarhat
Copy link

CharlesFarhat commented Nov 1, 2024

Description

Would be super useful to solve situation where you have a stack of decorators :

    @retry() -> last catch the error and retry
    @handle_errors -> if call crashes, for now hacky but will save the usage and pass the error
    @save_usage(callback=lambda metrics: print(f"\nMetrics: {metrics}")) -> will save usage of each call
    @with_logfire() -> record the call
    @litellm.call(model="gpt-4o-mini", stream=True, call_params={"stream_options": {"include_usage": True}})
    @prompt_template(
@CharlesFarhat CharlesFarhat added the Feature Request New feature or request label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant