Core concepts(核心概念)¶
The following core concepts are essential to understanding and getting the most out of AIP Chatbot Studio (previously known as AIP Agent Studio). You can learn more about applying these concepts in the Getting started tutorial.
AIP Chatbots¶
AIP Chatbots (previously known as AIP Agents) are interactive assistants equipped with enterprise-specific information and tools.
Application state¶
The application state, previously known as parameters, are application variables within prompts that customize and control the LLM's behavior. They allow for dynamic input and can be adjusted based on the task requirements.
Instructions and descriptions¶
Instructions, tool descriptions, and variable descriptions are compiled into the raw system prompt for the LLM. This teaches the LLM how to complete a task using the available context.
For the instructions, begin with the most important information, such as an overview of the task. Follow this with the necessary data and guidance on using the application state and tools.
For each tool and variable description, provide the LLM with concrete steps on how and when to use that specific piece of context. Keep in mind that an LLM only has access to the information you explicitly provide.
Retrieval-augmented generation (RAG)¶
Retrieval-augmented generation leverages external data sources to provide the LLM with relevant information dynamically. This method enhances the LLM's responses by ensuring they are based on the most current and contextually appropriate data.
Retrieval context¶
Retrieval context refers to the specific information retrieved in response to each message, which is used to generate a response. The process is as follows:
- User sends a new message.
- Based on the user's message, fetch relevant content from configured data sources.
- Include the relevant content along with the user's message to the LLM.
For more details, review the retrieval context documentation.
Tools¶
Tools are external functionalities or APIs that the LLM can use to perform specific actions or retrieve information beyond its base capabilities.
For more details, review the tools documentation.
Vector embeddings¶
Embeddings are numerical representations of text that capture semantic meaning. They are used to compare and retrieve similar pieces of text efficiently. In AIP Chatbot Studio, embeddings help identify relevant documents and context to provide accurate responses.
Context window¶
The context window refers to the amount of text (usually measured in tokens) that an LLM can process at one time. In AIP Chatbot Studio, the context window includes the system prompt, conversation history, and the information injected to assist the LLM (including retrieval context, application state, and tools). Exceeding the context window will result in an error, prompting users to create a new session to continue their interaction.
Chatbots as Functions¶
Chatbots can be published as Functions, which allows them to be used anywhere in the platform where Functions can be executed. For example, builders can publish AIP Chatbots as Functions to evaluate them in AIP Evals, to automate chatbot workflows with Automate, or to use chatbots in Code Repositories. For more information, refer to the chatbots as Functions documentation.
中文翻译¶
核心概念¶
以下核心概念对于理解和充分利用 AIP Chatbot Studio(原名 AIP Agent Studio)至关重要。您可以在入门指南教程中进一步了解如何应用这些概念。
AIP 聊天机器人¶
AIP 聊天机器人(原名 AIP 智能体)是配备企业特定信息和工具的交互式助手。
应用状态¶
应用状态(原名参数)是提示词中的应用程序变量,用于定制和控制大语言模型的行为。它们支持动态输入,并可根据任务需求进行调整。
指令与描述¶
指令、工具描述和变量描述会被编译成大语言模型的原始系统提示词。这教会大语言模型如何利用可用上下文完成任务。
编写指令时,请从最重要的信息开始,例如任务概述。随后提供必要的数据以及关于如何使用应用状态和工具的指导。
对于每个工具和变量描述,请向大语言模型提供具体步骤,说明如何以及何时使用该特定上下文。请记住,大语言模型只能访问您明确提供的信息。
检索增强生成(RAG)¶
检索增强生成利用外部数据源动态地向大语言模型提供相关信息。这种方法通过确保响应基于最新且上下文适当的数据,来增强大语言模型的回答质量。
检索上下文¶
检索上下文是指针对每条消息检索到的特定信息,用于生成响应。其流程如下:
- 用户发送新消息。
- 根据用户的消息,从配置的数据源中获取相关内容。
- 将相关内容连同用户的消息一起发送给大语言模型。
更多详情,请查阅检索上下文文档。
工具¶
工具是大语言模型可调用的外部功能或 API,用于执行特定操作或检索超出其基础能力的信息。
更多详情,请查阅工具文档。
向量嵌入¶
嵌入是文本的数值表示形式,能够捕捉语义含义。它们用于高效地比较和检索相似的文本片段。在 AIP Chatbot Studio 中,嵌入有助于识别相关文档和上下文,从而提供准确的响应。
上下文窗口¶
上下文窗口指大语言模型一次能处理的文本量(通常以 token 为单位)。在 AIP Chatbot Studio 中,上下文窗口包括系统提示词、对话历史以及为辅助大语言模型而注入的信息(包括检索上下文、应用状态和工具)。超出上下文窗口将导致错误,提示用户创建新会话以继续交互。
聊天机器人即函数¶
聊天机器人可以发布为函数,从而使其能够在平台中任何可执行函数的位置使用。例如,构建者可以将 AIP 聊天机器人发布为函数,以便在 AIP Evals 中进行评估、通过 Automate 自动化聊天机器人工作流,或在代码仓库中使用聊天机器人。更多信息,请参阅聊天机器人即函数文档。