Skip to content

Think Tool 节点(Think Tool node)#

思考工具节点是一个工具,它邀请代理在回答之前进行一些思考。本质上,它允许代理通过自我对话来反思问题,然后再提供答案。特别是,对于需要深思熟虑回答的复杂查询,这非常有用。

🌐 The Think Tool node is a tool that invites an agent to do some thinking before answering. Essentially, it allows the agent to reflect on the question by talking to itself before providing an answer. In particular, this is useful for complex queries that require a thoughtful response.

Parameter resolution in sub-nodes

Sub-nodes behave differently to other nodes when processing multiple items using an expression.

Most nodes, including root nodes, take any number of items as input, process these items, and output the results. You can use expressions to refer to input items, and the node resolves the expression for each item in turn. For example, given an input of five name values, the expression {{ $json.name }} resolves to each name in turn.

In sub-nodes, the expression always resolves to the first item. For example, given an input of five name values, the expression {{ $json.name }} always resolves to the first name.

模板和示例(Templates and examples)#

Template widget placeholder.

提示示例(Prompting example)#

例如,假设你向代理提出以下请求:

🌐 As an example, say you ask the agent:

Jack is looking at Anne. Anne is looking at George. Jack is married, George is not, and we don't know if Anne is married. Is a married person looking at an unmarried person?

代理将使用以下工具进行思考:

🌐 The agent will do its thinking with the tool:

我们有以下信息: 1. 杰克在看安妮。 2. 安妮在看乔治。 3. 杰克已婚。 4. 乔治未婚。 5. 我们不知道安妮是否已婚。

我们需要确定一个已婚的人是否正在看一个未婚的人。让我们来考虑安妮的两种情况:

案例 1:安妮已婚。

  • 如果安妮已婚,那么她(已婚)正在看着乔治(未婚)。在这种情况下,一个已婚的人(安妮)正在看着一个未婚的人(乔治)。

案例 2:安妮未婚。

  • 如果安妮未婚,那么杰克(已婚)正在看着安妮(未婚)。在这种情况下,一个已婚的人(杰克)正在看一个未婚的人(安妮)。

在这两种情况下,我们发现已婚人士正在看未婚人士。因此,这个问题的答案是肯定的。

然后提供答案:

🌐 and then afterward provide the answer:

Yes, a married person is looking at an unmarried person. In both possible scenarios regarding Anne's marital status, we find that a married individual (either Jack or Anne) is looking at an unmarried individual (either George or Anne).

Refer to LangChain's documentation on tools for more information about tools in LangChain.

View n8n's Advanced AI documentation.