3 ms·
The Assistants API doesn't let you recreate the conversation (with edits or not) because you can't (re)create messages with role=assistant.
by AgentME 3y ago
The Assistants API doesn't let you recreate the conversation (with edits or not) because you can't (re)create messages with role=assistant.
- arthurcolle 3y agoNot true
- baobabKoodaa 3y agoHow do you create messages as role assistant?
- d4rkp4ttern 3y agoThis was indeed true in the beginning, and I don’t know if this has changed. Inserting messages with Assistant role is crucial for many reasons, such as if you want to implement caching, or otherwise edit/compress a previous assistant response for cost or other reason. At the time I implemented a work-around in Langroid[1]: since you can only insert a “user” role message, prepend the content with ASSISTANT: whenever you want it to be treated as an assistant role. This actually works as expected and I was able to do caching. I explained it in this forum: https://community.openai.com/t/add-custom-roles-to-messages-in-threads/485446/4?u=darthfader https://community.openai.com/t/add-custom-roles-to-messages-... [1] the Langroid code that adds a message with a given role, using this above “assistant spoofing trick”: https://github.com/langroid/langroid/blob/main/langroid/agent/openai_assistant.py#L447 https://github.com/langroid/langroid/blob/main/langroid/agen...