stocky-sunset-29150
02/17/2024, 8:54 AMjolly-policeman-82775
02/17/2024, 9:20 AMjolly-policeman-82775
02/17/2024, 9:20 AMjolly-policeman-82775
02/17/2024, 9:20 AMstocky-sunset-29150
02/17/2024, 9:54 AMstocky-sunset-29150
02/17/2024, 9:54 AMjolly-policeman-82775
02/17/2024, 9:54 AMjolly-policeman-82775
02/17/2024, 10:49 AMjolly-policeman-82775
02/17/2024, 10:49 AMjolly-policeman-82775
02/17/2024, 10:49 AMjolly-policeman-82775
02/17/2024, 10:50 AMjolly-policeman-82775
02/17/2024, 10:50 AMstocky-sunset-29150
02/17/2024, 11:49 AMstocky-sunset-29150
02/17/2024, 11:49 AMjolly-policeman-82775
02/17/2024, 11:57 AMjolly-policeman-82775
02/17/2024, 11:57 AMjolly-policeman-82775
02/17/2024, 11:57 AMjolly-policeman-82775
02/17/2024, 11:57 AMjolly-policeman-82775
02/17/2024, 11:57 AMjolly-policeman-82775
02/17/2024, 11:57 AMfresh-fireman-491
02/17/2024, 12:06 PMfresh-fireman-491
02/17/2024, 12:11 PMstocky-sunset-29150
02/17/2024, 12:25 PMhttps://api.openai.com/v1/threads/${workflow.threadId}/runs
,
headers: {
'OpenAI-Beta': 'assistants=v1',
Authorization: Bearer ${env.openAIToken}
,
'Content-Type': 'application/json'
},
data: JSON.stringify({
assistant_id: env.assistantId
})
})
const runId = creationResponse.data.id
workflow.runId = runId
const waitTillRunComplete = async () => {
const statusResponse = await bot.retryingAxiosRequest({
method: 'get',
maxBodyLength: Infinity,
url: https://api.openai.com/v1/threads/${workflow.threadId}/runs/${runId}
,
headers: {
'OpenAI-Beta': 'assistants=v1',
Authorization: Bearer ${env.openAIToken}
,
'Content-Type': 'application/json'
}
})
if (['queued', 'in_progress'].includes(statusResponse.data.status) === false) {
console.log('the status is:', statusResponse.data.status)
if (statusResponse.data.status === 'requires_action') {
workflow.required_action = statusResponse.data.required_action
}
return
}
await new Promise((resolve) => {
setTimeout(resolve, 1000)
})
await waitTillRunComplete()
}
await waitTillRunComplete()stocky-sunset-29150
02/17/2024, 12:26 PMstocky-sunset-29150
02/17/2024, 12:26 PMstocky-sunset-29150
02/17/2024, 12:26 PMfresh-fireman-491
02/17/2024, 1:28 PMstocky-sunset-29150
02/17/2024, 10:44 PM