langchain
langchain copied to clipboard
OpenAI Assistants v2 api support for OpenAIAssistantRunnable
Title: "langchain: OpenAI Assistants v2 api support"
Descriptions
-
[x] As per latest OpenAI, "file_ids" are no supported and replaced with "attachments"
- Issue: error_code: 400: invalid keyword file_ids
-
[x] "tool_resources" support added while creating new assistant
-
Dependencies: OpenAI v2 API (openai>=1.23.0)
-
Twitter handle: @skanta_rath
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| langchain | ⬜️ Ignored (Inspect) | Visit Preview | May 21, 2024 10:26pm |
Hello! @eyurtsev @Anush008 @efriis @cbornet
Do you think you could help us here reviewing and approving? This is blocking the new OpenAI v2 Assistants and it's quite urgent :cry:
Thank you very much! :heart:
Will older versions of openai <1.23.6 still work after this change ?
mb unrelated question but OpenAI v2 Assistant now supports tool_choice parameter and streaming. Does it covered?
Will older versions of openai <1.23.6 still work after this change ?
Yes. They will work as these changes are backward compatible
@Surya-Kanta thanks for your fast iteration!
@Enase, Surya just added compatibility with tool_choice. As for streaming is not implemented yet. Please keep in mind that this PR is bugfixing not a new feature. Currently the assistants can't be migrated to v2 :cry:
@mbonet I will then continue working on complete migration of Assistants v2 in this branch.
@cbornet @Enase can we then merge? :pray:
I have already finished upgrade for all breaking changes related to v2 migration apart from streaming related changes. But I don't think streaming is a part of the upgrade. So, that should be a separate PR.
Anyone want to contribute in this PR are welcome in advance.
would be great to have this in the next release, as it's required to use the Assistants API v2 when you wanna use it in combination with GPT4o
@Enase, Surya just added compatibility with tool_choice
It's not true even if you fix the obvious issues, thanks for your effort but I don't get the reason why you declare something that wasn't done.
Hi all, thank you for this. To avoid breaking changes with earlier versions of the openai sdk I've moved this to a new class OpenAIAssistantV2Runnable. I've marked it as beta. Please post your feedback; PRs are also welcome.
@ccurme thanks!
Hello, has the update been released?
Hello, has the update been released?
This was moved to langchain-community and released today. If you pip install langchain-community==0.2.1 you can import it with:
from langchain_community.agents.openai_assistant import OpenAIAssistantV2Runnable
API reference: https://api.python.langchain.com/en/latest/agents/langchain_community.agents.openai_assistant.base.OpenAIAssistantV2Runnable.html
Note that this class is marked as beta; we welcome issues / PRs if you run into anything.
This is great. Does it support streaming yet?
@ccurme do you think we can improve the original docs?
https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base_v2.OpenAIAssistantV2Runnable.html
The suggested import is quite wrong langchain.agents no?
from langchain.agents.openai_assistant import OpenAIAssistantV2Runnable
As you pointed it should be from langchain_community namespace and it took me a good 2 hrs to notice this discrepancy :cry:
Looks like the pipeline is failing for this merge? Any indication when this will be successfully merged?
@codeonprod thanks for doing this!