Hello, unsure if anyone else is experiencing this but I’m unable to delete metadata from assistants through the assistants API (using node sdk).
ADDING new metadata and UPDATING metadata still works. However, if I send a map without a existing pair(s), the metadata will not not be updated with the removed pairs. Is this expected behavior? If so, how do we explicitly remove metadata?
CODE
console.log('>>>>>>>> metadata object', agentParams.metadata)
const updateParams = {
name: agentParams.name,
description: agentParams.description,
instructions: agentParams.instructions,
model: agentParams.model,
metadata: agentParams.metadata,
}
const openai = await getOpenAI(c)
const assistant = await openai.beta.assistants.update(agentParams.id, updateParams)
console.log('UPDATE PARAMS', updateParams)
LOGS
>>>>>>>> metadata object Object {
}
UPDATE PARAMS Object {
name: English Tutor,
description: Take care of English stuffs,
instructions: You are a personal english tutor. Write and run code to answer english questions.,
model: gpt-4-1106-preview,
metadata: Object
}
What I receive from the backend:
{
created_at: 1699777427,
description: "Take care of English stuffs",
file_ids: [],
id: "asst_zZ0Td78363rsvRq2Pe7usNB5",
instructions: "You are a personal english tutor. Write and run code to answer english questions.",
metadata: {
test: "123123"
},
model: "gpt-4-1106-preview",
name: "English Tutor",
object: "assistant",
tools: []
}
As you can see, despite sending an empty object (also tried with map), the API still sends me metadata back.
Steps to reproduce:
- Create an assistant with non-empty metadata.
- Update the assistant with an empty metadata object (to supposedly update to an empty metadata object)
- You will receive non-empty metadata