While creating the assistant using “file_ids” parameter in the body, facing Unknown parameter: ‘file_ids’ issue. Can you help on this ASAP.
Sample json used:
{
"name":"Test",
"instructions":"Test",
"model":"gtp-xx",
"tools":[{"type": "code_interpreter"}],
"file_ids": ["assistat_id1","assistant_id2"]
}
Hello,
You are using the old method I think. The body you have to send usually look like the example below. There is now file_ids parameter
name: body.name,
instructions: body.prompt,
model: model.name,
tools: [{ type: "file_search" }, { type: "code_interpreter" }],
tool_resources: {
...bodyTools
}
const batch = await openai.beta.vectorStores.create({
name: `Vector Store - ${body.name}`,
file_ids: allFileforFileSearch.map((f) => f.openAIFileId)
});
bodyTools['file_search'] = {
vector_store_ids: [batch.id]
};
}
const createdChatbot = await openai.beta.assistants.create({
name: body.name,
instructions: body.prompt,
model: model.name,
tools: [{ type: "file_search" }, { type: "code_interpreter" }],
tool_resources: {
...bodyTools
}
})
const chatbot = await db.chatbot.create({
Thanks for your response.
Indeed, the official documentation does not mention a filed_ids
key in the assistant
object.
However, if you look at the GitHub repository for the Python module, you can see that there is an optional file_ids
field within the ToolResourcesCodeInterpreter
of the assistant
object.
max context length.
"""
temperature: Optional[float] = None
"""What sampling temperature to use, between 0 and 2.
Higher values like 0.8 will make the output more random, while lower values like
0.2 will make it more focused and deterministic.
"""
tool_resources: Optional[ToolResources] = None
"""A set of resources that are used by the assistant's tools.
The resources are specific to the type of tool. For example, the
`code_interpreter` tool requires a list of file IDs, while the `file_search`
tool requires a list of vector store IDs.
"""
top_p: Optional[float] = None
"""
An alternative to sampling with temperature, called nucleus sampling, where the
from typing import List, Optional
from typing_extensions import Literal
from ..._models import BaseModel
__all__ = ["Thread", "ToolResources", "ToolResourcesCodeInterpreter", "ToolResourcesFileSearch"]
class ToolResourcesCodeInterpreter(BaseModel):
file_ids: Optional[List[str]] = None
"""
A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
available to the `code_interpreter` tool. There can be a maximum of 20 files
associated with the tool.
"""
class ToolResourcesFileSearch(BaseModel):
vector_store_ids: Optional[List[str]] = None
"""
It seems that this is where the file IDs used by tools like the code interpreter are specified and then returned as part of the assistant
object.
1 Like