You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched the LangChain.js documentation with the integrated search.
I used the GitHub search to find a similar question and didn't find it.
I am sure that this is a bug in LangChain.js rather than my code.
The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
Example Code
import { OpenAIAssistantRunnable } from "langchain/experimental/openai_assistant";
import { OpenAIFiles } from "langchain/experimental/openai_files";
const openAIFiles = new OpenAIFiles();
const file = await openAIFiles.createFile({
file: fs.createReadStream(path.resolve(__dirname, `./test.txt`)),
purpose: "assistants",
});
const assistant = await OpenAIAssistantRunnable.createAssistant({
model: "gpt-3.5-turbo-1106",
instructions:
"You are a weather bot. Use the provided functions to answer questions.",
name: "Weather Assistant",
tools
});
const response = await assistant.invoke({
content: "Please look at the weather data from the provided file and give some insights"
fileIds: [file.id] // This is the current payload required from the code
});
// Fix should be this
const response = await assistant.invoke({
content: "Please look at the weather data from the provided file and give some insights"
attachments: [{
file_id: fileId,
tools: [{type: "code_interpreter"}]
}]
});
@zachary-nguyen Hello! I'm here to help you with bugs, questions, and becoming a contributor. Let's tackle this issue together.
To resolve the "Unknown parameter: 'file_ids'" error, you should adjust the structure of the invoke method call. The error indicates that the file_ids parameter is not recognized, and it seems like the correct approach is to use the attachments field instead. Here's how you can modify your code:
constresponse=awaitassistant.invoke({content: "Please look at the weather data from the provided file and give some insights",attachments: [{file_id: file.id,tools: [{type: "code_interpreter"}]}]});
This change aligns with the expected structure for handling file attachments in the invoke method, using the attachments array to specify the file_id and any associated tools [1].
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
I'm trying to use an assistant to parse a file and provide some feedback on the data.
Getting the above error when trying to invoke the assistant
System Info
Linux
Node: 18.18.2
The text was updated successfully, but these errors were encountered: