Skip to content

Instantly share code, notes, and snippets.

@czue
Created August 25, 2023 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save czue/81eea58cb718e67be7c57c224800e304 to your computer and use it in GitHub Desktop.
Save czue/81eea58cb718e67be7c57c224800e304 to your computer and use it in GitHub Desktop.
OpenAI function for Source Citations in a RAG architecture
{
"name": "answer_and_sources",
"description": "Gets an answer and cites the relevant sources used to provide the answer.",
"parameters": {
"type": "object",
"properties": {
"answer": {
"type": "string",
"description": "The answer to the user's question.",
},
"sources": {
"type": "array",
"items": {
"type": "number",
},
"description": "The IDs of any sources which were used in generating the answer.",
},
},
"required": ["answer", "sources"],
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment