Share feedback, ideas and get community help

F
M
a
g
E

Removing Citation Annotations from Open AI Assistant Responses

First of all, this is perhaps the BEST implementation of Open AI Assistants API I've seen in an application. Thank you.

My issue is with the citations that get printed in responses such as 【9†source】. They're particularly a problem when I pass the response to a TTS block as the AI ends up speaking the citation itself ("nine plus source").

Is there a way to remove the citation? Or get it to work as something the user can click instead of displaying on screen (I'm not a developer, but saw something about this in the docs here: https://platform.openai.com/docs/assistants/how-it-works/message-annotations).
J
B
3 comments
[SOLVED] I'm not a coder but ChatGPT helped me with this and I found a way to remove the citations by setting a variable with Javascript. In case anyone else might have a similar need, the code is below:

const inputText = {{Assistant Message}};

const regex = /【\d+†source】/g;

const outputText = inputText.replace(regex, '');

return outputText;
Thanks for the feedback I did not know the assistant automatically append the annotations to the message.
Add a reply
Sign up and join the conversation on Discord
Join