Retry

Historical Vercel v0 Model API example; use the current alternatives below.

This example assumes an invalid model ID triggers the configured retries. Invalid-model responses commonly use terminal 400 or 404 statuses, which Agno does not retry. Do not run this source as a retry test.

The v0 Model API used by Agno's V0 adapter has been removed, as announced in the provider-maintained package notice. This page preserves a historical example. The current v0 Platform API manages chats, messages and files; it is a separate API and does not replace this model constructor.

retry.py
"""Example demonstrating how to set up retries with Vercel AI."""

from agno.agent import Agent
from agno.models.vercel import V0

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "vercel-wrong-id"

agent = Agent(
    model=V0(
        id=wrong_model_id,
        retries=3,  # Number of times to retry the request.
        delay_between_retries=1,  # Delay between retries in seconds.
        exponential_backoff=True,  # If True, the delay between retries is doubled each time.
    ),
)

agent.print_response("What is the capital of France?")

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    pass

Current alternatives

Use the current v0 Platform API for v0 application-generation workflows. To run an Agno model agent, follow the complete OpenAI Chat example and its provider setup. The archived program above targets the removed Model API.

Full source: cookbook/90_models/vercel/retry.py