Feature #3579
Updated by Ram Kordale 6 months ago
call_openai_api(model, index, assistant_id, thread_id) -get <assistant_id, instructions, prompt prefix, prompt suffix> for <model, index> from DS -if (assistant_id == "") --return error //this will is not happen to users known) -else --get instruction for index --assistant_id = GET https://api.openai.com/v1/assistants/{assistant_id} -if (thread_id == "") --create_assistant(name, model, temperature=0.2) [POST https://api.openai.com/v1/assistants] --thread_id = create_thread() --create_thread() [POST https://api.openai.com/v1/threads] -else --thread_id = GET --GET https://api.openai.com/v1/assistants/{assistant_id} --GET https://api.openai.com/v1/threads/{thread_id} -create message [POST https://api.openai.com/v1/threads/{thread_id}/messages] -return assistant_id, thread_id