Search
View: 53|Reply: 1
Print Prev. thread Next thread

Metadata not deleting - using Node SDK

[ Promote this link! ]

79

!threads!

0

Friends

647

Money

member

Rank: 1

Jump to specified page
1#
Post time 2025-4-7 21:53:48 |Show the author posts only |Descending
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

    [color=var(--hljs-variable)]console.[color=var(--hljs-title)]log([color=var(--hljs-string)]'>>>>>>>> metadata object', agentParams.metadata)    [color=var(--hljs-keyword)]const updateParams = {      [color=var(--hljs-attr)]name: agentParams.name,      [color=var(--hljs-attr)]description: agentParams.description,      [color=var(--hljs-attr)]instructions: agentParams.instructions,      [color=var(--hljs-attr)]model: agentParams.model,      [color=var(--hljs-attr)]metadata: agentParams.metadata,    }    [color=var(--hljs-keyword)]const openai = [color=var(--hljs-keyword)]await [color=var(--hljs-title)]getOpenAI(c)    [color=var(--hljs-keyword)]const assistant = [color=var(--hljs-keyword)]await openai.beta.assistants.[color=var(--hljs-title)]update(agentParams.id, updateParams)    [color=var(--hljs-variable)]console.[color=var(--hljs-title)]log([color=var(--hljs-string)]'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:

{  [color=var(--hljs-attr)]created_at: [color=var(--hljs-number)]1699777427,  [color=var(--hljs-attr)]description: [color=var(--hljs-string)]"Take care of English stuffs",  [color=var(--hljs-attr)]file_ids: [],  [color=var(--hljs-attr)]id: [color=var(--hljs-string)]"asst_zZ0Td78363rsvRq2Pe7usNB5",  [color=var(--hljs-attr)]instructions: [color=var(--hljs-string)]"You are a personal english tutor. Write and run code to answer english questions.",  [color=var(--hljs-attr)]metadata: {    [color=var(--hljs-attr)]test: [color=var(--hljs-string)]"123123"  },  [color=var(--hljs-attr)]model: [color=var(--hljs-string)]"gpt-4-1106-preview",  [color=var(--hljs-attr)]name: [color=var(--hljs-string)]"English Tutor",  [color=var(--hljs-attr)]object: [color=var(--hljs-string)]"assistant",  [color=var(--hljs-attr)]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

11

!threads!

0

Friends

347

Money

member

Rank: 1

2#
Post time 2025-4-7 21:55:27 |Show the author posts only
If deleting metadata isn't working as expected, it might be worth checking if there's any caching issue or if the metadata is still associated with another object. Also, make sure you're passing the correct parameters in the API call. I've had similar issues when integrating metadata management into a dam workflow, and rechecking the payload structure helped. If you're updating instead of fully deleting, a null value might be needed.
You have to log in before you can reply Login | 立即注册

Heyshell

2025-4-30 02:14 GMT+8 , Processed in 0.036091 second(s), 19 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

To Top