quivr

2025-12-11 0 965

quivr您的第二个大脑,由生成AI授权

quivr ,可以帮助您建立第二个大脑,利用Generativeai成为您的私人助理的力量!

关键功能

  • 意见抹布:我们创建了一个自以为是,快速和高效的抹布,因此您可以专注于您的产品
  • LLMS : quivr与任何LLM一起使用,您可以将其与OpenAI,人类,Mistral,Gemma和Etch一起使用。
  • 任何文件: quivr与任何文件一起使用,您可以将其与PDF,TXT,Markdown等一起使用,甚至可以添加自己的解析器。
  • 自定义抹布: quivr允许您自定义抹布,添加Internet搜索,添加工具等。
  • 与Megaparse的集成: quivr可与Megaparse一起使用,因此您可以用Megaparse摄入文件,并与quivr一起使用抹布。

我们照顾抹布,因此您可以专注于产品。只需安装quivr -core并将其添加到您的项目中。您现在可以摄取文件并提出问题。*

我们将改善抹布并添加更多功能,敬请期待!

这是quivr的核心,是quivr .com的大脑。

入门

您可以在文档中找到所有内容。

先决条件?

确保您安装了以下内容:

  • Python 3.10或更新

30秒安装?

  • 步骤1 :安装软件包

    pip install quivr -core # Check that the installation worked
  • 步骤2 :创建带有5行代码的抹布

    quivr_core import Brain

    if __name__ == "__main__":
    with tempfile.NamedTemporaryFile(mode="w", suffix=".txt") as temp_file:
    temp_file.write("Gold is a liquid of blue-like colour.")
    temp_file.flush()

    brain = Brain.from_files(
    name="test_brain",
    file_paths=[temp_file.name],
    )

    answer = brain.ask(
    "what is gold? asnwer in french"
    )
    print("answer:", answer)\”>

     import tempfile
    
    from quivr _core import Brain
    
    if __name__ == \"__main__\" :
        with tempfile . NamedTemporaryFile ( mode = \"w\" , suffix = \".txt\" ) as temp_file :
            temp_file . write ( \"Gold is a liquid of blue-like colour.\" )
            temp_file . flush ()
    
            brain = Brain . from_files (
                name = \"test_brain\" ,
                file_paths = [ temp_file . name ],
            )
    
            answer = brain . ask (
                \"what is gold? asnwer in french\"
            )
            print ( \"answer:\" , answer )

配置

工作流程

基本抹布

像上面的一个一样,创建一个基本的抹布工作流很简单,以下是:

  1. 将您的API键添加到环境变量
 import os
os . environ [ \"OPENAI_API_KEY\" ] = \"myopenai_apikey\"

quivr支持人类,Openai和Mistral的API。它还使用Ollama支持本地模型。

  1. 创建yaml文件basic_rag_workflow.yaml并复制其中的以下内容
 workflow_config :
  name : \" standard RAG \"
  nodes :
    - name : \" START \"
      edges : [\"filter_history\"]

    - name : \" filter_history \"
      edges : [\"rewrite\"]

    - name : \" rewrite \"
      edges : [\"retrieve\"]

    - name : \" retrieve \"
      edges : [\"generate_rag\"]

    - name : \" generate_rag \" # the name of the last node, from which we want to stream the answer to the user
      edges : [\"END\"]

# Maximum number of previous conversation iterations
# to include in the context of the answer
max_history : 10

# Reranker configuration
reranker_config :
  # The reranker supplier to use
  supplier : \" cohere \"

  # The model to use for the reranker for the given supplier
  model : \" rerank-multilingual-v3.0 \"

  # Number of chunks returned by the reranker
  top_n : 5

# Configuration for the LLM
llm_config :

  # maximum number of tokens passed to the LLM to generate the answer
  max_input_tokens : 4000

  # temperature for the LLM
  temperature : 0.7
  1. 用默认配置创建大脑

quivr_core import Brain

brain = Brain.from_files(name = "my smart brain",
file_paths = ["./my_first_doc.pdf", "./my_second_doc.txt"],
)
\”>

 from quivr _core import Brain

brain = Brain . from_files ( name = \"my smart brain\" ,
                        file_paths = [ \"./my_first_doc.pdf\" , \"./my_second_doc.txt\" ],
                        )
  1. 启动聊天

quivr_core.config import RetrievalConfig

config_file_name = "./basic_rag_workflow.yaml"

retrieval_config = RetrievalConfig.from_yaml(config_file_name)

console = Console()
console.print(Panel.fit("Ask your brain !", style="bold magenta"))

while True:
# Get user input
question = Prompt.ask("[bold cyan]Question[/bold cyan]")

# Check if user wants to exit
if question.lower() == "exit":
console.print(Panel("Goodbye!", style="bold yellow"))
break

answer = brain.ask(question, retrieval_config=retrieval_config)
# Print the answer with typing effect
console.print(f"[bold green] quivr Assistant[/bold green]: {answer.answer}")

console.print("-" * console.width)

brain.print_info()\”>

 brain . print_info ()

from rich . console import Console
from rich . panel import Panel
from rich . prompt import Prompt
from quivr _core . config import RetrievalConfig

config_file_name = \"./basic_rag_workflow.yaml\"

retrieval_config = RetrievalConfig . from_yaml ( config_file_name )

console = Console ()
console . print ( Panel . fit ( \"Ask your brain !\" , style = \"bold magenta\" ))

while True :
    # Get user input
    question = Prompt . ask ( \"[bold cyan]Question[/bold cyan]\" )

    # Check if user wants to exit
    if question . lower () == \"exit\" :
        console . print ( Panel ( \"Goodbye!\" , style = \"bold yellow\" ))
        break

    answer = brain . ask ( question , retrieval_config = retrieval_config )
    # Print the answer with typing effect
    console . print ( f\"[bold green] quivr Assistant[/bold green]: { answer . answer } \" )

    console . print ( \"-\" * console . width )

brain . print_info ()
  1. 现在,您可以通过更改配置文件来与大脑交谈并测试不同的检索策略!

走得更远

您可以通过添加Internet搜索,添加工具等来进一步使用quivr 。查看文档以获取更多信息。

贡献者

谢谢这些好人:

贡献?

您收到拉的请求吗?打开它,我们将尽快进行检查。在此处查看我们的项目委员会,以了解我们目前关注的内容,并随时将您的新想法带到餐桌上!

  • 开放问题
  • 打开拉的请求
  • 好的第一个问题

合作伙伴❤️

没有我们的合作伙伴的支持,这个项目将是不可能的。谢谢您的支持!

许可证?

该项目已在Apache 2.0许可证下获得许可 – 有关详细信息,请参见许可证文件

下载源码

通过命令行克隆项目:

git clone https://github.com/QuivrHQ/quivr.git

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

申明:本文由第三方发布,内容仅代表作者观点,与本网站无关。对本文以及其中全部或者部分内容的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。本网发布或转载文章出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,也不代表本网对其真实性负责。

左子网 编程相关 quivr https://www.zuozi.net/33950.html

AutoHotkey
上一篇: AutoHotkey
photoprism
下一篇: photoprism
常见问题
  • 1、自动:拍下后,点击(下载)链接即可下载;2、手动:拍下后,联系卖家发放即可或者联系官方找开发者发货。
查看详情
  • 1、源码默认交易周期:手动发货商品为1-3天,并且用户付款金额将会进入平台担保直到交易完成或者3-7天即可发放,如遇纠纷无限期延长收款金额直至纠纷解决或者退款!;
查看详情
  • 1、描述:源码描述(含标题)与实际源码不一致的(例:货不对板); 2、演示:有演示站时,与实际源码小于95%一致的(但描述中有”不保证完全一样、有变化的可能性”类似显著声明的除外); 3、发货:不发货可无理由退款; 4、安装:免费提供安装服务的源码但卖家不履行的; 5、收费:价格虚标,额外收取其他费用的(但描述中有显著声明或双方交易前有商定的除外); 6、其他:如质量方面的硬性常规问题BUG等。 注:经核实符合上述任一,均支持退款,但卖家予以积极解决问题则除外。
查看详情
  • 1、左子会对双方交易的过程及交易商品的快照进行永久存档,以确保交易的真实、有效、安全! 2、左子无法对如“永久包更新”、“永久技术支持”等类似交易之后的商家承诺做担保,请买家自行鉴别; 3、在源码同时有网站演示与图片演示,且站演与图演不一致时,默认按图演作为纠纷评判依据(特别声明或有商定除外); 4、在没有”无任何正当退款依据”的前提下,商品写有”一旦售出,概不支持退款”等类似的声明,视为无效声明; 5、在未拍下前,双方在QQ上所商定的交易内容,亦可成为纠纷评判依据(商定与描述冲突时,商定为准); 6、因聊天记录可作为纠纷评判依据,故双方联系时,只与对方在左子上所留的QQ、手机号沟通,以防对方不承认自我承诺。 7、虽然交易产生纠纷的几率很小,但一定要保留如聊天记录、手机短信等这样的重要信息,以防产生纠纷时便于左子介入快速处理。
查看详情

相关文章

猜你喜欢
发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务