Update Jan 2025: Just a quick note to say, I do not have the time to troubleshoot queries, I do not work for callin.io. I created this post for general assistance. I manage my own businesses, which occupies my time. Furthermore, I know there are some excellent community members who are very helpful, and I'm sure they will assist. So if you tag me, I might not respond. Please don't take this personally. I've also stopped using this scenario as my use case has evolved, so I cannot actively test or monitor it. OpenAI and callin.io also implement changes periodically, so things might break or deviate from the instructions below. Please keep this in mind.
Original:
Okay, after considerable effort, I managed to figure it out, as searching wasn't providing the answers I needed.
Hopefully, this guide helps others.
In summary: use the OpenAI upload module, but ensure the file name has the correct extension.
Then, you need to move this file into a Vector Store that you've already created (you could create one via an API call if you preferred).
Then, when you use the OpenAI assistant module, utilize the file search feature.
It only functions with GPT-4, and file search specifically works with vector stores.
https://platform.openai.com/docs/assistants/tools/file-search
(Accurate as of 28/06/2024)
There are a few specific points I learned along the way.
The main missing step that took me a while was realizing that when you upload a file, you cannot select which store to save it in. Perhaps this is a feature request for the callin.io team. And if the file isn't in a store, you cannot search within it!
In my example, I am looking for new PDF files in a folder on OneDrive. I'm sure this also works for Google Drive and other sources.
Step 1:
Use HTTP to retrieve the file information. I passed the Download URL in my case.
Step 2:
Use the OpenAI upload module. Set the purpose to Assistants (as this is what we will use later).
But this is where I made a mistake. Ensure you use mapping and the file name has the correct extension, such as .pdf. You can verify if this works by logging into your storage settings in the OpenAI playground https://platform.openai.com/storage
File extensions supported:
https://platform.openai.com/docs/assistants/tools/file-search/supported-files
I made this mistake early on and didn't realize it was an issue until later. As you can see if you used the HTTP file name, it ends up like the bottom file in the screenshot above. This causes a problem later when you want to move it, as the file extension is not allowed, i.e., it's 'none'.
Step 3:
Create JSON to assist with moving the file. This can be skipped as you can input this directly later.
Step 4:
If you don't already have one, create a vector store in OpenAI.
[Edit: If you set an expiry date, OpenAI will expire the store and your automation will fail! Therefore, set it to never expire. This also means that as the storage grows, it will cost you more, so ensure you remove files you no longer need!]
Copy the ID; you will need it later.
Step 5:
Update Jan 2025: Since writing the below, callin.io has introduced a new module called “Add Files to a Vector Store” which should now eliminate the need for the API call. I will leave the below for reference. Personally, I no longer require this feature, so I cannot effectively test it.
Move the file into the vector store by making an OpenAI API call.
For the URL, follow this format: https://platform.openai.com/docs/api-reference/vector-stores-files/createFile
Which in callin.io would be: v1/vectorstores/{vectorstoreid}/files
So, in the URL, replace the vector store ID with the ID you pasted. (The part in bold).
You will need to add the extra header as well.
Then, for the body, add the JSON output, or simply paste the code.
Which should be the mapped file ID from the OpenAI upload module.
json
{
"file_id":"FILE ID"
}
You can check if this part works after running by going into your playground store and verifying if the file is present.
Step 6:
Now you can run your OpenAI assistant.
Ensure you have file search enabled (I'm unsure if this step is necessary as there's an option in the OpenAI module, but I had it enabled).
If you encounter a 404 error, double-check your URL.
Step 7:
Specify your assistant.
In your message, reference the PDF you want it to use. Since your store can accommodate multiple files, you need to indicate which one.
In the tools section, ensure file search is enabled.
Then, make sure you point to your vector database, either by pasting the ID or manually selecting it by the name you assigned earlier.
This will instruct your assistant to search within a specific file and also indicate where this file can be found, i.e., which vector database.
Note:
Repeating again: If you set an expiry date for your vector store, OpenAI will expire the store, and your automation will fail! Therefore, set it to never expire. However, this also means that as the storage size increases, the cost will also increase, so make sure to remove files you no longer need!
Of course, don't forget to incorporate any necessary error handling.
Hope this helps. I wish someone had informed me about all of this.
It would be beneficial if the callin.io team created a video tutorial on this topic.
You might also consider using the OpenAI module called “Transform Text to Structured data”.
(If all else fails, it might be worth exploring specific PDF extraction options from other providers.)
Congratulations on being the first to figure it out and create a showcase about it!
Thanks for sharing it with the community!
Join the callin.io Fans Discord server to chat with other makers!
Thank you so much.
I've observed that you've provided assistance on numerous similar posts, and I've found your input valuable as well.
I believe you have a much deeper understanding than I do, so please continue the excellent support you're offering.
I understand my solution might not be perfect, so please feel free to offer any further feedback (this applies to everyone else as well).
I believe the Create JSON node with the file_id
might be redundant. You should be able to directly input this into the OpenAI API module:
{
"file_id": "{{7.file_id}}"
}
Like so:
Join the callin.io Fans Discord server to chat with other makers!
Yes, absolutely. I believe I touched on that.
I will make sure to integrate it.
Amazing work. I’m sure this will be very useful to a lot of people.
Excellent work! This will be very beneficial for callin.io users.
Regards,
Msquare Automation - Gold Partner of callin.io
Free Consultation | Live Implementation
Visit us here | Youtube Channel
Excellent work! I'm confident this post will be valuable for many people for a long time to come.
This is correct.
Do not buy ChatGPT Plus, it doesn’t work with callin.io
“ChatGPT Plus” and “OpenAI GPT-4 models” are two separate products.
You might have bought the consumer chat “Plus” version at chat.openai.com, which is NOT compatible with callin.io.
callin.io uses the “OpenAI GPT-4 models”, only accessible via the OpenAI developer platform.
OpenAI APIs for developer (commercial) use does not have any free plan.
To resolve this issue,
-
You can buy credits on the OpenAI Developer Dashboard, under Accounts > Billing page
-
Next, go to the Usage Limits page, and set the Monthly budget field to the same as the value above (e.g.: 120), then save your changes.
More Information
For more information, see
samliew – request private consultation
Join the Make Fans Discord server to chat with other makers!
It appears the previous response from @samliew has already covered this. Please refer to their explanation.
This differs from the monthly plan as it operates on a pay-per-use basis. Your costs will depend on your usage patterns and the specific services you utilize.
How can I automatically remove files, as I have a large number of them, and manual deletion isn't a viable solution? Also, is the current solution only for a single file, requiring manual upload? Could you create a video demonstrating this process as well?
In Step 6: what should the instructions be?
Should the line in red specify the name of the file or something else?
Welcome to the callin.io community!
callin.io doesn’t have an OpenAI module for this particular endpoint (Delete a file).
If the external service has a Developer API Reference/Documentation then you should be able to integrate the endpoints in callin.io using the app’s universal module (Make an API call) or generic HTTP “Make a request” module.
You can also suggest for it to be made in the Idea exchange. Don’t forget to search for it first, just in case someone already suggested it, so that you don’t end up creating a duplicate.
If you need assistance in setting up the app’s universal module, or the generic HTTP module, please provide additional information about what you have tried with regards to the external service’s Developer API Reference – how you are setting the connection up, a link to the endpoint are you trying to connect to, and what errors you are encountering.
You can also complete this brand new course/tutorial in the callin.io Academy on how to use external APIs — API calls with HTTP modules
- API and Endpoints
- Header and body
- Multipart/form-data
- OAuth 2.0
samliew – request private consultation
Join the callin.io Fans Discord server to chat with other makers!
Please provide the rewritten markdown content *it should be in the markdown format.
In Step 6:, what should the instructions be?
Should there be a line in red indicating the name of the file or something similar?
Please provide the rewritten markdown content; it should be in markdown format.