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
When attempting to integrate the OpenAIAssistantAdapter within a CopilotRuntime environment, the operation fails with a 400 Invalid value error. The error message says [Error: 400 Invalid value: 'retrieval'. Supported values are: 'code_interpreter', 'function', and 'file_search'.] This issue occurs when trying to configure the OpenAIAssistantAdapter with an unsupported tool type.
I've identified the specific breaking error in CopilotKit's openai-assistant-adapter. It stems for the move to V2 Assistants API.
From the openAI migration documentation from April 17:
The v2 version of the Assistants API contains the following changes:
- Tool rename: The retrieval tool has been renamed to the file_search tool
- Files belong to tools: Files are now associated with tools instead of Assistants and Messages. This means that:
AssistantFile and MessageFile objects no longer exist.
Instead of AssistantFile and MessageFile, files are attached to Assistants and Threads using the new tool_resources object.
The tool_resources for the code interpreter tool are a list of file_ids.
The tool_resources for the file_search tool are a new object called a vector_stores.
Messages now have an attachments, rather than a file_ids parameter. Message attachments are helpers that add the files to a Thread’s tool_resources.
Until you make this change, OpenAIAssistantAdapter will be broken on the V2 API it's currently pointing to. You will want to double check the other migration steps mentioned in that documentation as well.
The alternative is for you to update the code to v1 for now, though this api will be discontinued by end of year.
When attempting to integrate the OpenAIAssistantAdapter within a CopilotRuntime environment, the operation fails with a 400 Invalid value error. The error message says [Error: 400 Invalid value: 'retrieval'. Supported values are: 'code_interpreter', 'function', and 'file_search'.] This issue occurs when trying to configure the OpenAIAssistantAdapter with an unsupported tool type.
Error:
Error getting response: [Error: 400 Invalid value: 'retrieval'. Supported values are: 'code_interpreter', 'function', and 'file_search'.] {status: 400, ...}
To Reproduce
Import CopilotRuntime and OpenAIAssistantAdapter from @copilotkit/backend.
import { CopilotRuntime, OpenAIAssistantAdapter } from "@copilotkit/backend"; export const runtime = "edge";
Set up a basic server with the CopilotRuntime.
Expected behavior
The API should successfully return a chat completion response from the OpenAI server.
The text was updated successfully, but these errors were encountered: