REST API Streaming Assistant
Use OpenAI Assistant with BuildShip to generate stream responses to your prompts.
Report this template
Select the reason for reporting
Describe the issue in detail
Use OpenAI Assistant with BuildShip to generate stream responses to your prompts.
Report this template
Select the reason for reporting
Describe the issue in detail
message
threadId
Assistant ID
A simple AI Assistant with conversational memory that you can chat with, that returns a stream response.
In this example of a personal history tutor AI Assistant, it helps you answer questions quickly or give you interesting historical facts.
This template uses the OpenAI Assistant (Stream Response). Here's what you'll need to successfully test out the template:
You can get your OpenAI API Key from the OpenAI Developer Dashboard.
Create an OpenAI Assistant on the OpenAI Developer Dashboard > Assistants, and copy the Assistant ID.
The OpenAI Assistant (Stream Response) node can't be tested in a traditional manner. When tested, it will return an object as output, which can be read to generate a stream. However, it will appear to be a regular javascript object when viewed in the test panel. You may, however, test it out from the Usage tab of the Chatbot Widget trigger that the template comes with.
Once the API Key and the Assistant ID is added, the workflow is ready to be used. After receiving an HTTP Request, the workflow will response a Readable stream object in the HTTP Response body for you to use. It will also include the thread ID in a header with the key set to x-thread-id
.
The default template uses the OpenAI Assistant node. To customize, click on the Additional settings to reveal additional customizable options, like the Thread ID, the Stream Content Form (regular text chunks or server-sent-events) and the Built-in Tools provided by OpenAI, like File Search and Code Interpreter.