Pre-requisites
- Created a Trigger.dev project & job
- Followed the Authentication steps to set up an organization and API key.
- Installed the Parea SDK:
npm i parea-ai
Instrumenting your OpenAI calls
Assuming you are calling OpenAI through Trigger.dev like this:- Instantiate the Parea client in the beginning of your application
- Wrap
io.openai.chat.completions.create
withtraceOpenAITriggerDev
. This will automatically log any OpenAI call and send it to Parea.
Visualizing your traces
You will see the OpenAI call appear in the dashboard as shown below: