Assistants API: replacing model generated substrings with annotations (No/lowcode Implementation)

(This question is within the context of Zapier/nocode tools. I’ve also asked on those forums without success.)

ChatGPT with retrieval turned on often returns annotations that are illegible, e.g. 【13†source】.

According to Open AI’s docs, there is a way to convert them to legible text in the annotations. But to see them, there’s a python code snippet they recommend:

Retrieve the message object

message = client.beta.threads.messages.retrieve(

Extract the message content

message_content = message.content[0].text
annotations = message_content.annotations
citations =

Iterate over the annotations and add footnotes

for index, annotation in enumerate(annotations):
# Replace the text with a footnote
message_content.value = message_content.value.replace(annotation.text, f’ [{index}]')

# Gather citations based on annotation attributes
if (file_citation := getattr(annotation, 'file_citation', None)):
    cited_file = client.files.retrieve(file_citation.file_id)
    citations.append(f'[{index}] {file_citation.quote} from {cited_file.filename}')
elif (file_path := getattr(annotation, 'file_path', None)):
    cited_file = client.files.retrieve(file_path.file_id)
    citations.append(f'[{index}] Click <here> to download {cited_file.filename}')
    # Note: File download functionality not implemented above for brevity

Add footnotes to the end of the message before displaying to user

message_content.value += ‘\n’ + ‘\n’.join(citations)

Now, I’m trying to implement this primarily in Zapier, and I’m not a coder (though ChatGPT helps me with any coding work I might come across). My question is: is there a way to use the above information (taken from the documentation here) to convert the illegible annotations to readable text annotations in our responses and do this within Zapier or other no/lowcode interfaces?