通过Assistants API创建一个assistant id并选择模型,如有需要可考虑关联上传好的file并开启Code Interpreter、Retrieval和Function calling、Web Search等工具;
注:仅在该步骤关联file并开启retrieval时,retrieval才会生效,并会对向量存储进行计费;
在用户发送请求时,通过Thread API创建一个thread id,并通过Message向thread id创建并添加一条message id;
使用thread id关联assistant id创建run,运行以得到请求回复,有需要时该Assistant会自动使用file调用此前启用的相关工具;
通过retrieve run检索run的完成状态,如已完成,可以通过list message查看回复