Python code to create a new collection in owui, or upload documents to an existing one (the knowledge_id appears in the collection URL). It also allows you to continue the upload if it has been interrupted or if you stop it with Ctrl+C.
Just change the url of your openwebui and your api key.