OpenAI Assistants Template
1.0.0
欢迎来到OpenAI助理模板!该存储库是一个逐步的教程,用于利用Openai强大的助手API来建立聪明和对话的AI助手。无论您是开发人员,学生还是AI爱好者,本指南都将帮助您利用GPT模型为项目的力量。
为了充分利用本教程,您应该有:
example.env .envpip install -r requirements.txt以安装依赖项。 探索OpenAI-Assistant-Template.ipynb的动手体验,可引导您浏览助理API的能力,并具有实用的例子。
潜入modules.py找到实用程序功能和类,可提供更清洁,更可维护的代码库,从而易于构建。
modules.py中功能吗?create_assistant(client, name, description, instructions, tools=[], model="") :创建一个新助手get_assistant(client, assistant_id) :使用助手ID检索现有助手。start_new_chat(client) :与AI助手启动新对话。get_chat(client, thread_id) :使用线程ID检索现有对话。add_message(client, thread, content) :在对话线程中向助手发送新消息。get_messages_in_chat(client, thread) :在对话线程中获取所有以前的消息。run_chat(client, thread, assistant) :通过助手处理对话线程以生成响应。 您的贡献使开源社区成为创新的令人难以置信的舞台。如果您有关于如何使此模板更好的想法,则欢迎您的拉力请求!让我们让Openai学习AI对每个人都有令人兴奋的旅程。
该项目是根据MIT许可证开源的。随意使用它。