Example tasks
Call OpenAI with retrying
This example will show you how to call OpenAI with retrying using Trigger.dev.
Overview
Sometimes OpenAI calls can take a long time to complete, or they can fail. This task will retry if the API call fails completely or if the response is empty.
Task code
trigger/openai.ts
Testing your task
To test this task in the dashboard, you can use the following payload:
Was this page helpful?