matrixgpt / matrix-chatgpt-bot

Talk to ChatGPT via any Matrix client!
GNU Affero General Public License v3.0
238 stars 64 forks source link

initial commit for official api usage #250

Closed max298 closed 1 year ago

max298 commented 1 year ago

I've spent some time checking out the official library from OpenAI. The assistants api (which is still in beta) looks like a perfect match for our use-case, as it uses threadIds which persist in order to keep the context.

Please also note that this merge would change the data saved inside the database (no more messageId), so I don't know if it's even possible to upgrade from a older version (and even if, you'd break your old threads).

This is not a "real" merge request - I just played around and got the bot in a working state (which is not well tested and also not well coded). I just thought it might be useful to have the code in case we ever decide to use the assistants api.

Initially I wanted to take a look at the gpt-4-vision-preview (see #247), however this model is not supported with the assistants api:

"The requested model 'gpt-4-vision-preview' cannot be used with the Assistants API."

I think it would be really cool to have the vision-feature within this bot, so I don't know how I feel about the assistants api.

bertybuttface commented 1 year ago

I really like this idea! We don't currently support vision anyway and OpenAI may yet add it to the Assistant API. Thanks for sharing your work so we can all start thinking about how this should work.