Skip to content

Define retry policy when generation request timeouts #894

@OrGivati

Description

@OrGivati

We are using gemini using ai-sdk(@ai-sdk/google-vertex:4.0.15) and also some of the OpenAI models.
From time to time, some generation request take too long - +300 second(see image).

Image

My questions:

  1. can I control the timeout of the generation request?
  2. can I define retry policy for the agent to apply in case generation fails on timeout? or other exceptions?

if we will be able to set to the run options(SharedRunOptions) retry policy on generation request based on the errors type thrown by the provider, it can help improve the reliability of the agent run.
Both by providing custom timeout I can fail request early and with the retry policy I can recover in case of failures.

Debug information

  • Agents SDK version: (e.g. v0.4.0)
  • Runtime environment (e.g. Node.js 22.19.0)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions