Skip to content

Create a helper function to poll for agent deployment readiness #40

@bbatha

Description

@bbatha

When a Gradient AI Platform Agent is started it needs to deploy which can take 30s or longer. Currently users must write loops to poll for the agent state, roughly.

from gradient import Gradient

client = Gradient()
while True:
  agent = client.agents.retrieve(
      "uuid",
  )
 if agent.agent.deployment.status != "STATUS_RUNNING":
    continue

This should of course handle failed states for errors and such

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