Tip: Making Assistants API return better annotations (besides file names)

Usually, even if you use File Search of Assistant API or Knowledge of GPTs, it returns files names only as annotations. It’s not enough people to validate the answer.

To get the actual reference content, you can ask OpenAI to include it in the answer. However, I found that adding it to instructions is not enough. You should put it at the end of each query. For example, you can add below text after your query to include the actual reference content:

How long is the probation period?

Include references after the answer in this format: """
# References
**[Section Title Here](https://section-link-here.com/path)**
> Exact content body of the references
"""

In this way, you can have more reliable answer. I’d love to learn if you guys have more tips to make annotations work better!

Slack example references postfix

2 Likes

I like it :slight_smile:

According to the haystack papers, your concept might break down if you’re dealing with significantly longer outputs.

But also according to them, putting your schema instructions at the very very top of your system instructions should work just as well. I’m not convinced of that, but it’s something one could in theory keep in mind.

1 Like

Thank you for your kind reply. I agree with you that the issue can be resolved in near future. However, from the industry perspective, we need something right now. I hope this approach can resolve some of the current obstacles.

This was very useful. We’ll be building a more complete way to reference the content, but in the meantime this helped a lot. thanks!