INNER CODE UNIT · Swift
func
ZachNagengast/similarity-search-kit · Sources/SimilaritySearchKit/Core/Index/SimilarityIndex.swift:199
public class func exportLLMPrompt(query: String, results: [SearchResult]) -> String {
let sourcesText = combinedResultsString(results)
let prompt =
"""
Given the following extracted parts of a long document and a question, create a final answer with references ("SOURCES").
If you don't know the answer, just say that you don't know. Don't try to make up an answer.
ALWAYS return a "SOURCES" part in your answer.
QUESTION: \(query)
=========
\(sourcesText)
=========
FINAL ANSWER:
"""
return prompt
}
}