How to Customize File Annotations in Superinterface
Annotations in Superinterface are small indicators that show when your assistant references a file in its responses. These annotations help users know exactly where certain pieces of information are coming from, making your assistant’s answers more transparent and reliable. By enabling and customizing annotations, you give your assistant the ability to show where the information originates.
In this guide, we’ll walk you through setting up and customizing file annotations using Superinterface and OpenAI’s Assistant API. This will allow your assistant to access, cite, and display files in a clear and user-friendly way.
Step One: Create an Assistant in OpenAI’s Platform
Create an Assistant in OpenAI's Platform
Click Create New Assistant and give it a name (e.g., "My Assistant with Files").
Under the Tools section, enable File Search by clicking the plus (+) next to it.
Select and upload the files your assistant will use.
For this guide, we are using a pitch demo as an example document, but you can upload any relevant file for your use case. Once uploaded, the assistant will now have access to these files for its interactions.
Step Two: Sync with Superinterface
Sync your assistant on Superinterface with OpenAI's Assistance API
Syncing your assistant with OpenAI pulls over all the details from the OpenAI platform—like the assistant’s name, instructions, and tools, including the file search function. This is important because without enabling file search, your assistant won’t be able to search through and access the files you've uploaded.
Head over to your Superinterface dashboard and select your assistant or create a new one.
Select OpenAI as the provider and choose the OpenAI Assistant API in the thread storage configuration.
Find the assistant you just created in OpenAI by navigating to the OpenAI Assistant menu, then select it (e.g., "My Assistant with Files").
Click Sync with OpenAI to synchronize all settings, tools, and files between Superinterface and OpenAI.
Step Three: Customize Annotations
Now that your assistant is synced with OpenAI, we can customize how source file annotations are shown.
Go to the Publish section of the Assistant menu in Superinterface. Click Choose Interface and either select an existing interface or create a new one to work with.
Navigate to the Components section, where you’ll see two components: Suggestions and Annotations.
Click Edit Settings under Annotations.
Ensure Annotations are enabled. This means an annotation icon will appear when the assistant references a file in its response. If disabled, the assistant will still use the file, but there will be no visual indication that the file was referenced.
Under Type, choose between:
Minimal: The icon will display a simple tooltip stating that a file was cited when clicked.
Source: The icon will display the actual source file that was referenced, providing more context for the user.
"Source" annotation style
After selecting your preferred option (e.g., Source), click Save to apply the changes.
Step Four: Re-upload Your Files to Superinterface
Since OpenAI's Assistant API processes files without allowing retrieval of the original files, we need to re-upload the files to Superinterface to enable the Source feature. This is done through vector stores, which are databases that store text and files as numerical representations (vectors) so the assistant can easily search and retrieve relevant information.
Re-uploading files to Superinterface
Navigate to the Vector Stores section under Annotations tab.
Select the vector store associated with your assistant. If you have multiple vector stores, repeat this process for each one.
Click View Files next to the appropriate vector store. You will see a list of files connected to the assistant.
Click Browse Files for each file listed and re-upload the same files to Superinterface.
Ready to Publish?
You did it! Your assistant is now fully set up and ready to reference and display source files. If you're satisfied with your interface setup, it's time to add your assistant to your website.
Simply click Publish to integrate it with your site. For a detailed guide on how to publish, go to Publish Interface.