My experiments with the OpenAi Assistants API
These experiments use Javascript and Php to interact with the OpenAi API. This makes it possible to host a web app Assistant on a low cost shared server, because shared servers have Php pre-installed. When using Python, for example, one would need to rent a server and then install Python on it. That server is a lot more expensive and takes more work to set up and maintain.
This is the workflow as quoted in the docs:
- Create an Assistant in the API by defining its custom instructions and picking a model. If helpful, enable tools like Code Interpreter, Retrieval, and Function calling.
- Create a Thread when a user starts a conversation.
- Add Messages to the Thread as the user ask questions.
- Run the Assistant on the Thread to trigger responses. This automatically calls the relevant tools.
-
Exp_01 - Simple Javascript Code to Create an Assistant
https://github.com/vbookshelf/OpenAi-Assistants-API-Experiments/tree/main/Exp_01-Simple-Javascript-Code-to-Create-Assistant -
Exp_02 - Javascript code to List all assistants and Delete an assistant
https://github.com/vbookshelf/OpenAi-Assistants-API-Experiments/tree/main/Exp_02-List-and-Delete-Assistants-Javascript -
Exp_03 - Upload File to Web Server and then transfer to OpenAi Assistants
https://github.com/vbookshelf/OpenAi-Assistants-API-Experiments/tree/main/Exp_3-File-upload-to-web-server-and-transfer-to-openai-assistants -
Exp_04 - Simple Php Code to Create an Assistant
https://github.com/vbookshelf/OpenAi-Assistants-API-Experiments/tree/main/Exp_04-Simple-Php-Code-to-Create-an-Assistant -
Exp_05 - Php code to List all assistants and Delete an assistant
https://github.com/vbookshelf/OpenAi-Assistants-API-Experiments/tree/main/Exp_05-Php-code-to-list-all-assistants-and-delete-an-assistant -
Exp_06 - Upload File to OpenAi in one click
https://github.com/vbookshelf/OpenAi-Assistants-API-Experiments/tree/main/Exp_06-Upload-file-to-openai-in-one-click -
Exp_07 - Attach a File to an Assistant
https://github.com/vbookshelf/OpenAi-Assistants-API-Experiments/tree/main/Exp_07-Attach-a-file-to-an-assistant -
Exp_08 - Create a Thread
https://github.com/vbookshelf/OpenAi-Assistants-API-Experiments/tree/main/Exp_08-Create-a-Thread -
Exp_09 - Create a Message
https://github.com/vbookshelf/OpenAi-Assistants-API-Experiments/tree/main/Exp_09-Create-a-message -
Exp_10 - Retrieve a Thread
https://github.com/vbookshelf/OpenAi-Assistants-API-Experiments/tree/main/Exp_10-Retrieve-a-thread -
Exp_11 - Retrieve a Run
https://github.com/vbookshelf/OpenAi-Assistants-API-Experiments/tree/main/Exp_11-Retrieve-a-run -
Exp_12 - List all messages on a thread
https://github.com/vbookshelf/OpenAi-Assistants-API-Experiments/tree/main/Exp_12-List-all-messages-on-a-thread -
Exp_13 - Run a thread
https://github.com/vbookshelf/OpenAi-Assistants-API-Experiments/tree/main/Exp_13-Run-a-thread -
Exp_14 - Upload a file and attach it to an assistant in one click
https://github.com/vbookshelf/OpenAi-Assistants-API-Experiments/tree/main/Exp_014-Upload-file-and-attach-to-assistant-in-one-click -
Exp_15 - Create a working web app that includes file upload
https://github.com/vbookshelf/OpenAi-Assistants-API-Experiments/tree/main/Exp_15-Working-web-app-with-file-upload -
Exp_16 - Create a working web app that includes the uploaded file id in the message
https://github.com/vbookshelf/OpenAi-Assistants-API-Experiments/tree/main/Exp_16-Web-app-with-uploaded-file-id-included-in-message
-
OpenAI Assistant API Tutorial With Code Examples
https://www.youtube.com/watch?v=-HrILeVJwMY -
Assistants API Overview
https://platform.openai.com/docs/assistants/overview -
Assistants API Docs
https://platform.openai.com/docs/api-reference/assistants -
Assistants API Tools Docs
https://platform.openai.com/docs/assistants/tools -
View all created assistants on OpenAi
https://platform.openai.com/assistants -
OpenAi File upload docs
https://platform.openai.com/docs/api-reference/files/create -
View all uploaded files on OpenAi
https://platform.openai.com/files -
OpenAi 'Create Assistant File' docs
https://platform.openai.com/docs/api-reference/assistants/createAssistantFile -
OpenAi 'Create Thread' docs
https://platform.openai.com/docs/api-reference/threads/createThread -
OpenAi 'Create Message' docs
https://platform.openai.com/docs/api-reference/messages/createMessage -
OpenAi 'Retrieve Thread' docs
https://platform.openai.com/docs/api-reference/threads/getThread -
OpenAi 'Retrieve Run' docs
https://platform.openai.com/docs/api-reference/runs/getRun -
OpenAi 'List Messages' docs
https://platform.openai.com/docs/api-reference/messages/listMessages -
OpenAi 'Create Run' docs
https://platform.openai.com/docs/api-reference/runs/createRun -
OpenAi 'How Assistants work' docs
This explains what happens when a thread is run.
https://platform.openai.com/docs/assistants/how-it-works/agents