#turning off source citing

1 messages · Page 1 of 1 (latest)

prime elbow
#

I am working with the Assitant API and, as it happens in the Playground, GPT provides in the response a link to the reference (in case a reference document has been added for the Assitant).

My question is if there is some parameter in the Assitant API that disables the appearance of these links to the reference, or some way to read only the part that does not include the reference.

I don’t want to have to ‘clean’ the answer to remove that part. I would like there to be some parameter that would do this for me.

Thanks in advance.

trim tinselBOT
#

Hi @prime elbow. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the information provided in the extracts, there isn't a direct parameter in the Assistant API that disables the appearance of these links to the reference. However, there is a workaround suggested by a support user in the OpenAI community forum. The user suggests using a regular expression (regex) to strip out the source citations from the response message. Here's the code snippet provided:

import re

message_text = ("This is a sample text【9†source】 with source "
"tags using annotations【10†source】and some other content.")

# Use regex to remove source citations
cleaned_text = re.sub('【.*?†source】', '', message_text)

This code will remove any text that matches the pattern 【.*?†source】, which is the pattern used for source citations in the response message.

You can find more details in the OpenAI community forum post (https://community.openai.com/t/599121).

Please note that this method requires you to 'clean' the response message in your code. As of now, there isn't a built-in parameter in the Assistant API that can do this for you.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: