Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The Assistants API doesn't let you recreate the conversation (with edits or not) because you can't (re)create messages with role=assistant.


This 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-...

[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/agen...


Not true


How do you create messages as role assistant?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: