import type { FunctionDefinition } from '../../definition_types'; /** * Use `TOP_SNIPPETS` to extract the best snippets for a given query string from a text field. * * @example * FROM books * | EVAL snippets = TOP_SNIPPETS(description, "Tolkien") * * @example * FROM books * | WHERE MATCH(title, "Return") * | EVAL snippets = TOP_SNIPPETS(description, "Tolkien", { "num_snippets": 3, "num_words": 25 }) * * @example * FROM books * | WHERE MATCH(title, "return") * | RERANK "Tolkien" ON TOP_SNIPPETS(description, "Tolkien", { "num_snippets": 3, "num_words": 25 }) WITH { "inference_id" : "test_reranker" } * * @example * FROM books * | WHERE MATCH(title, "Return") * | EVAL snippets = TOP_SNIPPETS(description, "Tolkien", { "num_snippets": 1, "num_words": 25, "highlight": true }) * * @example * ROW chunks = ["Alice was beginning to get very tired of sitting by her sister on the bank. The white rabbit disappeared down a hole and Alice quickly jumped in after it. The rabbit hole went straight on like a tunnel for some way and then dipped suddenly.", "The Queen of Hearts ordered her soldiers to paint the white roses red."] * | EVAL snippets = TOP_SNIPPETS(chunks, "alice rabbit hole", {"num_words": 0, "highlight": true}) * * @example * ROW content = CONCAT( * "# Climate Change Solutions\\n\\n", * "## Renewable Energy\\n", * "Solar and wind power are becoming cost-competitive with fossil fuels. Investment in clean energy infrastructure creates jobs.\\n\\n", * "## Carbon Capture\\n", * "Direct air capture technology removes CO2 from the atmosphere. These systems require significant energy input but show promise for large-scale deployment.\\n\\n", * "## Policy Changes\\n", * "Government regulations can accelerate the transition to clean energy through carbon pricing and renewable energy mandates.") * | EVAL chunked_content = CHUNK(content, {"strategy": "recursive", "max_chunk_size": 30, "separators": ["##", "\\n\\n"]}) * | EVAL snippets = TOP_SNIPPETS(chunked_content, "clean energy", {"num_words": 0, "num_snippets": 1, "highlight":true}) * | KEEP snippets */ declare const definition: FunctionDefinition; export default definition; //# sourceMappingURL=top_snippets.d.ts.map