Aha, sorry for misreading your request!
So, potential workarounds:
Gensim via smart_open can often take an already-open file-like object instead of a path/URL. So, depending on exactly which Gensim IO-using functions you're using, you *may* be able to open the file yourself, using smart_open directly, then pass that (single front-to-back streamable) file-descriptor to the Gensim function instead of a string path/URL.
Other Gensim IO (like opening a `.save()` model that may be multiple separate files deduced by their one 'main' file) may still require a path/URL.
In those cases, you *might* be able to work-around the current limitations by "monkey-patching" the `smart_open.open` function that Gensim is about to use to add your extra parameters. This risks side effects – be sure to read-up on the risks of moneky-patching if you're unfamiliar with the technique – but *might* be fine in your pattern of use.
Very roughly (untested & my variable-args syntax is rusty):
# assumes you've already set up your custom boto3 Session/client into `my_s3_client`
inner_open = smart_open.open
def my_open(*args, **kwargs):
return inner_open(*args, **kwargs, transport_params={'client': my_s3_client)})
gensim.util.open = my_open # clobber the original `open`
# do your Gensim IO that needs your modification
# ...
gensim.util.open = old_open # reset just in case it'd break other later opens
Let me know if either of these tactics work for your purposes, or if your specific use runs into other problems.
- Gordon