Cannot upload files to Assistants from Langchain

I am trying to create one assistant agent in Langchain with multiple files through Langchain

runnable = OpenAIAssistantRunnable(assistant_id=assistant_detail['id'], as_agent=True)
response = runnable.invoke({'content': detailed_query, 'file_ids': asst_file_ids})

The docstring of the invoke() and ainvoke() method also indicates passing file_ids list in input dict. But it throws the below error code.

2024-05-07T07:44:17.354655636Z openai.OpenAIError: Error code: 400 - {'error': {'message': "Unknown parameter: 'thread.messages[0].file_ids'.", 'type': 'invalid_request_error', 'param': 'thread.messages[0].file_ids', 'code': 'unknown_parameter'}}

FYI my ENV is as below:

Python 3.11

openai==1.26.0
langchain==0.1.17
langchain-community==0.0.37
langchain-core==0.1.52
langchain-experimental==0.0.57
langchain-openai==0.1.6

Any help is appreciated.

The problem is not on OpenAI is in LangChain

There is an issue open for at least 3 weeks since OpenAI proposed v2 on the Assistants/Agents.

This is the issue:

1 Like