Core concepts(核心概念)¶
The following core concepts are essential to understanding and getting the most out of AIP Logic. You can learn more about applying these concepts in the getting started tutorial.
Logic function¶
A Logic function takes inputs like Ontology objects or text strings, and returns an output that can be a value (such as a string), an object, or an edit to the Ontology itself.
Logic functions can be leveraged and used like any other function in the platform, such as in Workshop modules. To edit the Ontology, Logic functions must be published and called from an action. For more information, see how to use a Logic function in an action.
Blocks¶
Logic functions are composed of blocks. Blocks have many different purposes, such as reading or writing to the Ontology, performing a calculation, aggregating data, calling other functions, or interacting with an LLM. The output of a block can be used in subsequent blocks, enabling complex operations to be constructed by chaining blocks together.
Evaluations¶
After publishing a Logic function, you can configure Evaluations, which enable you to write detailed tests for your Logic functions. Evaluations for AIP Logic can be used to:
- Debug and improve Logic functions and prompts.
- Compare different models, like GPT-4 vs. GPT-3.5 on your functions.
- Examine variance across multiple runs of Logic functions.
Debugging¶
After composing a Logic function, you can run the function as a test. Running your function will open the Debugger panel, showing the LLM chain-of-thought (CoT) for the component blocks in the Logic function. Examining the LLM's CoT makes debugging easier by showing each individual step of the LLM’s "thought process" and providing information on any supporting tools used by the LLM.
中文翻译¶
核心概念¶
以下核心概念对于理解和充分利用 AIP Logic 至关重要。您可以通过入门教程进一步了解如何应用这些概念。
逻辑函数(Logic function)¶
逻辑函数接收输入(如 Ontology 对象或文本字符串),并返回输出,输出可以是值(如字符串)、对象或对 Ontology 本身的编辑。
逻辑函数可以像平台中的其他函数(如 Workshop 模块中的函数)一样被调用和使用。要编辑 Ontology,逻辑函数必须发布并通过操作(action)调用。更多信息,请参阅如何在操作中使用逻辑函数。
模块(Blocks)¶
逻辑函数由模块组成。模块具有多种用途,例如读取或写入 Ontology、执行计算、聚合数据、调用其他函数或与 LLM 交互。模块的输出可用于后续模块,从而通过串联模块构建复杂操作。
评估(Evaluations)¶
发布逻辑函数后,您可以配置评估,以便为逻辑函数编写详细的测试。AIP Logic 的评估可用于:
- 调试和改进逻辑函数及提示词(prompt)。
- 比较不同模型,例如在您的函数上对比 GPT-4 与 GPT-3.5。
- 检查逻辑函数多次运行之间的差异。
调试(Debugging)¶
编写逻辑函数后,您可以运行该函数进行测试。运行函数将打开调试器(Debugger)面板,显示逻辑函数中各个模块的 LLM 思维链(chain-of-thought, CoT)。通过检查 LLM 的思维链,可以查看 LLM "思考过程"的每个步骤,并获取 LLM 使用的任何辅助工具的相关信息,从而简化调试过程。