LibreChat icon indicating copy to clipboard operation
LibreChat copied to clipboard

Enhancement: OpenAI Assistants API V2 support

Open danny-avila opened this issue 10 months ago • 20 comments

Initial support added in https://github.com/danny-avila/LibreChat/pull/2781

5/19/24

Read the PR notes for more details on what changed, and what is still to be done.


Discussed in https://github.com/danny-avila/LibreChat/discussions/2489

Originally posted by sathyarajv April 22, 2024 OpenAI updated the Assistants API to V2 with changes to the tools and files. Refer the Migration steps here

image

Known issues: The attached files of an existing Assistants are not loading in the UI but its available on the OpenAI platform. Migrating to V2 will resolve this issue.

Any plan on this migration?

danny-avila avatar Apr 22 '24 16:04 danny-avila

Will this enhancement planned for v0.7.3 milestone completion allow for > 20 files?

scottbetza avatar Apr 23 '24 19:04 scottbetza

Will this enhancement planned for v0.7.3 milestone completion allow for > 20 files?

yes I think it's possible through vector stores

danny-avila avatar Apr 24 '24 16:04 danny-avila

Due to several undocumented, breaking and non-breaking changes, as well as gpt-4o support being exclusive to v2, this is a priority item for this week.

danny-avila avatar May 14 '24 19:05 danny-avila

Just a quick preview of what will be possible with Assistants V2 (also using gpt-4o):

https://github.com/danny-avila/LibreChat/assets/110412045/20a42ba8-bfbf-498d-8914-f72d7b5d4d1c

danny-avila avatar May 16 '24 21:05 danny-avila

I've made a lot of progress, and the initial support is almost done but not quite ready.

Azure integration breaks with the latest openai SDK versions, so I need to write old v1 methods for Azure file handling. Because of the differences with Azure, even later on, I've decided to make Azure Assistants its own endpoint, and there are also a few things to touch on to complete that process.

The way file attachments now work for tool resources is not fully complete for Code Interpreter, but is nearly done (just need to handle deleting from its tool_resources)

This is saying nothing of the new File Search vector store handling. This needs a completely new UI and file management system, which I've already started earlier this week.

My goal is to release the initial support tomorrow, with the ability to use all v2 features including file search, but no way manage/attach vector stores for file search yet, other than attaching files at the thread level.

I've addressed a lot of fixes for Assistants in the process, so I'm excited to get this out soon!

danny-avila avatar May 18 '24 03:05 danny-avila

Merging soon, read the full notes if you're interested!

https://github.com/danny-avila/LibreChat/pull/2781

danny-avila avatar May 19 '24 16:05 danny-avila

@danny-avila thanks so much for your work on this. I saw that Azure OpenAI announced support for assistants v2 today.

Passing this on in case it would (hopefully) be a comparatively easy task to add Azure support.

illgitthat avatar May 21 '24 18:05 illgitthat

@danny-avila thanks so much for your work on this. I saw that Azure OpenAI announced support for assistants v2 today.

Passing this on in case it would (hopefully) be a comparatively easy task to add Azure support.

Cool! i'll see if it's as easy as flipping a switch at this point

danny-avila avatar May 21 '24 19:05 danny-avila

Right now, I'm able to get v2 working which enables streaming for Azure Assistants, but it is really unreliable with files, even in playground. For anyone that wants to try: https://github.com/danny-avila/LibreChat/pull/2820

danny-avila avatar May 21 '24 21:05 danny-avila

Has anyone gotten gpt-4o working with Assistants in Librechat yet?

BennyMorton28 avatar May 28 '24 21:05 BennyMorton28

Has anyone gotten gpt-4o working with Assistants in Librechat yet?

Yup. On the latest build, it's fully functional: image

danny-avila avatar May 28 '24 22:05 danny-avila

Sorry to keep troubling on this issue, I can't get it to work. I updated my assistant on OpenAI to be gpt-4o, and in my librechat.yaml file, and then when I rebuild I get the error below. I am using Docker, but I think there might be an update issue to the latest Librechat, but I'm not sure how to update/get the latest build? Thanks for any help

Screenshot 2024-05-29 at 4 02 42 PM

BennyMorton28 avatar May 29 '24 21:05 BennyMorton28

Sorry to keep troubling on this issue, I can't get it to work. I updated my assistant on OpenAI to be gpt-4o, and in my librechat.yaml file, and then when I rebuild I get the error below. I am using Docker, but I think there might be an update issue to the latest Librechat, but I'm not sure how to update/get the latest build? Thanks for any help

I think you have a merge conflict while trying to update. Send an email to [email protected] and we can setup a time to troubleshoot live.

danny-avila avatar May 29 '24 21:05 danny-avila

I experience the same issue as the one above-mentioned. Is there any chance the error comes from wrong settings ni the librechat.yaml file ?

djuillard avatar Jun 26 '24 11:06 djuillard

I experience the same issue as the one above-mentioned. Is there any chance the error comes from wrong settings ni the librechat.yaml file ?

Only if its azure, the error above was not related to azure

danny-avila avatar Jun 26 '24 14:06 danny-avila

I experience the same issue as the one above-mentioned. Is there any chance the error comes from wrong settings ni the librechat.yaml file ?

Only if its azure, the error above was not related to azure

Yes, I'm on Azure.

djuillard avatar Jul 03 '24 18:07 djuillard

OpenAI released GPT-4o-mini. Unfortunately, it runs only on V2. Any plans to migrate? :)

Error updating assistant 400 The requested model 'gpt-4o-mini' cannot be used with the Assistants API in v1. Follow the migration guide to upgrade to v2: https://platform.openai.com/docs/assistants/migration.

xfoggi avatar Jul 19 '24 05:07 xfoggi

Just to add my voice on this, Azure OpenAI Assistants V2 support would be incredibly helpful. I would really like to be using GPT-4o for these (and soon GPT-4o mini)

kezzzsVS avatar Aug 12 '24 09:08 kezzzsVS

Are vector stores now supported in v0.74?

scottbetza avatar Aug 14 '24 21:08 scottbetza

Are vector stores now supported in v0.74?

No, what you're asking for is a file browser for an OpenAI integration. Something like this will come for a native Agents integration before it's done for OpenAI, where you can already configure this on their dashboard

danny-avila avatar Aug 15 '24 01:08 danny-avila