TABLE dateformat(file.ctime,"yyyy-MM-dd HH:mm:ss") as "created", file.size as "size" WHERE this.file.name = dateformat(file.ctime,"yyyy-MM-dd")
SORT file.ctime ASC

langchain

Quickstart Guide — 🦜🔗 LangChain 0.0.147

LangChain is a framework for developing applications powered by language models. We believe that the most powerful and differentiated applications will not only call out to a language model via an API, but will also:
LangChain 是一个用于开发由语言模型驱动的应用程序的框架。我们相信,最强大和差异化的应用程序不仅会通过 API 调用语言模型,而且还会:

  • Be data-aware: connect a language model to other sources of data
    数据感知:将语言模型连接到其他数据源

  • Be agentic: allow a language model to interact with its environment
    Be agentic:允许语言模型与其环境交互

The LangChain framework is designed with the above principles in mind.
LangChain 框架的设计考虑了上述原则。

This is the Python specific portion of the documentation. For a purely conceptual guide to LangChain, see here. For the JavaScript documentation, see here.
这是文档的 Python 特定部分。有关 LangChain 的纯概念指南,请参见此处。有关 JavaScript 文档,请参见此处。

Getting Started 开始 

Checkout the below guide for a walkthrough of how to get started using LangChain to create an Language Model application.
查看以下指南,了解如何开始使用 LangChain 创建语言模型应用程序。

Modules

There are several main modules that LangChain provides support for. For each module we provide some examples to get started, how-to guides, reference docs, and conceptual guides. These modules are, in increasing order of complexity:
LangChain 提供支持的主要模块有几个。对于每个模块,我们都提供了一些入门示例、操作指南、参考文档和概念指南。这些模块的复杂性递增:

  • Models: The various model types and model integrations LangChain supports.
    模型:LangChain 支持的各种模型类型和模型集成。

  • Prompts: This includes prompt management, prompt optimization, and prompt serialization.
    提示:这包括提示管理、提示优化和提示序列化。

  • Memory: Memory is the concept of persisting state between calls of a chain/agent. LangChain provides a standard interface for memory, a collection of memory implementations, and examples of chains/agents that use memory.
    内存:内存是链/代理调用之间持久状态的概念。 LangChain 提供了内存的标准接口、内存实现的集合以及使用内存的链/代理的示例。

  • Indexes: Language models are often more powerful when combined with your own text data - this module covers best practices for doing exactly that.
    索引:当与您自己的文本数据结合使用时,语言模型通常会更强大 - 本模块涵盖了执行此操作的最佳实践。

  • Chains: Chains go beyond just a single LLM call, and are sequences of calls (whether to an LLM or a different utility). LangChain provides a standard interface for chains, lots of integrations with other tools, and end-to-end chains for common applications.
    链:链不仅仅是单个 LLM 调用,而且是调用序列(无论是对 LLM 还是对不同的实用程序)。 LangChain 为链提供标准接口、与其他工具的大量集成以及用于常见应用程序的端到端链。

  • Agents: Agents involve an LLM making decisions about which Actions to take, taking that Action, seeing an Observation, and repeating that until done. LangChain provides a standard interface for agents, a selection of agents to choose from, and examples of end to end agents.
    代理:代理涉及 LLM 决定采取哪些行动,采取该行动,观察观察,并重复直到完成。 LangChain 为代理提供了一个标准接口,可供选择的代理选择,以及端到端代理的示例。

Use Cases 用例 

The above modules can be used in a variety of ways. LangChain also provides guidance and assistance in this. Below are some of the common use cases LangChain supports.
可以以多种方式使用上述模块。 LangChain 也在这方面提供指导和帮助。以下是 LangChain 支持的一些常见用例。

  • Autonomous Agents: Autonomous agents are long running agents that take many steps in an attempt to accomplish an objective. Examples include AutoGPT and BabyAGI.
    自治代理:自治代理是长时间运行的代理,它们采取许多步骤来尝试实现目标。示例包括 AutoGPT 和 BabyAGI。

  • Agent Simulations: Putting agents in a sandbox and observing how they interact with each other or to events can be an interesting way to observe their long-term memory abilities.
    代理模拟:将代理置于沙箱中并观察它们如何相互交互或与事件交互可能是观察其长期记忆能力的一种有趣方式。

  • Personal Assistants: The main LangChain use case. Personal assistants need to take actions, remember interactions, and have knowledge about your data.
    个人助理:LangChain 的主要用例。个人助理需要采取行动、记住交互并了解您的数据。

  • Question Answering: The second big LangChain use case. Answering questions over specific documents, only utilizing the information in those documents to construct an answer.
    问答:LangChain 第二大用例。回答针对特定文件的问题,仅利用这些文件中的信息来构建答案。

  • Chatbots: Since language models are good at producing text, that makes them ideal for creating chatbots.
    聊天机器人:由于语言模型擅长生成文本,这使它们成为创建聊天机器人的理想选择。

  • Querying Tabular Data: If you want to understand how to use LLMs to query data that is stored in a tabular format (csvs, SQL, dataframes, etc) you should read this page.
    查询表格数据:如果您想了解如何使用 LLM 查询以表格格式(csvs、SQL、数据帧等)存储的数据,您应该阅读此页面。

  • Code Understanding: If you want to understand how to use LLMs to query source code from github, you should read this page.
    代码理解:如果你想了解如何使用 LLM 从 github 查询源代码,你应该阅读此页面。

  • Interacting with APIs: Enabling LLMs to interact with APIs is extremely powerful in order to give them more up-to-date information and allow them to take actions.
    与 API 交互:使 LLM 能够与 API 交互非常强大,以便为他们提供更多最新信息并允许他们采取行动。

  • Extraction: Extract structured information from text.
    提取:从文本中提取结构化信息。

  • Summarization: Summarizing longer documents into shorter, more condensed chunks of information. A type of Data Augmented Generation.
    总结:将较长的文档总结成更短、更浓缩的信息块。一种数据增强生成。

  • Evaluation: Generative models are notoriously hard to evaluate with traditional metrics. One new way of evaluating them is using language models themselves to do the evaluation. LangChain provides some prompts/chains for assisting in this.
    评估:众所周知,生成模型很难用传统指标进行评估。评估它们的一种新方法是使用语言模型本身进行评估。 LangChain 提供了一些提示/链来协助这一点。