Some of my AI work is pretty heavy, 2-4min long.. some others comes up to 10min.
I am trying to limit the req to only last for a certain amount of time, then I want to stop it.
const completion = await openAI.chat.completions.parse(
{
model: "gpt 5-mini",
messages: [
{
role: "system",
content: `text`,
},
{
role: "user",
content: `text`,
},
],
response_format: zodResponseFormat(JobPostingSchema, "job_posting"),
},
{
signal: this.abortController.signal,
}
I have looked at the parse typing and it says it has timeout AND signal, but I get an error everytime?
Can´t find anything for aborting the req... Any tips?
parse type in comments