Skip to content

Instantly share code, notes, and snippets.

@netoxico
Forked from czue/function.js
Created February 24, 2024 03:42
Show Gist options
  • Save netoxico/7499fe929d68ccfcba99a0a7d513a1c8 to your computer and use it in GitHub Desktop.
Save netoxico/7499fe929d68ccfcba99a0a7d513a1c8 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