由 Evangelos Lamprou 开发的令人愉快的LLM插件,它增加了执行“语义搜索”的能力 – 允许您根据使用 LLM 的提示来确定排序顺序,对文件的内容进行排序。
自述文件中的这些示例可以很好地说明:
llm sort --query "Which names is more suitable for a pet monkey?" names.txt cat titles.txt | llm sort --query "Which book should I read to cook better?"
它使用这个成对的提示符来工作,该提示符使用Python的sorted(documents, key=functools.cmp_to_key(compare_callback))
机制执行多次:
Given the query: {query} Compare the following two lines: Line A: {docA} Line B: {docB} Which line is more relevant to the query? Please answer with "Line A" or "Line B".
标签: llm 、插件、生成人工智能、 ai 、 llms 、 python
原文: https://simonwillison.net/2025/Feb/11/llm-sort/#atom-everything