You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ability to retry on task failure-with options for retry delays including exponential backoff-would be useful functionality to interface from ControlFlow directly. It's possible with ControlFlow and Prefect, but requires knowledge of Prefect.
Use Case
Retrying API calls is a common need with LLMs.
Proposed Implementation
AddingdirectlytoControlFlowtaskkeywordargumentsmightbenice.
```pythontask=cf.Task(
objective="Write a poem about the provided topic",
instructions="Write four lines that rhyme",
context={"topic": "AI"},
retries=4
)
Context from Prefect Community Slack:
quick question: in ControlFlow is there a way to apply exponential backoff to avoid rate limiting? I got a few error messages after the agents running for a few minutes:
...
Enhancement Description
The ability to retry on task failure-with options for retry delays including exponential backoff-would be useful functionality to interface from ControlFlow directly. It's possible with ControlFlow and Prefect, but requires knowledge of Prefect.
Use Case
Retrying API calls is a common need with LLMs.
Proposed Implementation
Context from Prefect Community Slack:
Solution from @zzstoatzz:
from prefect.tasks import exponential_backoff
from prefect import task
t = task(lambda: 1/0)
with_retries = t.with_options(retries=10, retry_delay_seconds=exponential_backoff(3))
python
@task(retries=..., ...)
def some_callable(): ...
The text was updated successfully, but these errors were encountered: