Hi,
New to this and super excited for what custom-gpt can unlock!
I was inspired by this post and a few others related: Unable to upload files from a custom ChatGPT session via an API action - GPT builders / Plugins / Actions builders - OpenAI Developer Community when trying to solve issue of how to get images/files that are dropped into the custom-GPT window out to another system.
Several older posts comment it can’t be done, or that base64 is too long.
As everything else and what has me so excited to work with custom-GPT solutions is you just need to provide it to tools to do something in a structured way.
So for this scenario, enabled code-interpreter
Uploaded python-functions.py knowledge base file.
Cheated a bit so the python code includes the comments/description and usage of each function (so no need to overload your instruction set).
The TL;DR of is, create function that allows chunking the base64 dynamically (chunk size can change), index, and termination signal. Once the LLM has the tools it’ll adjust and retry until you get success path.
It’s not fast (we are working with Base64 after all) but it’s functional.
- File generated or dropped into custom-GPT
- LLM converts to Base64
- LLM breaks into chunks (and optionally gzips)
- LLM sends chunks in a payload including index and key that can be easily reconstructed
On the receiving end: just concatenate using index, gzip if compressed flag was on, and you’re done.
I uploaded text file with the python and sample yaml action (not the server/end but should be sufficient) in Filebin | mc2osu7ak9qvwxnx