OpenAI Functions Agent 节点#
¥OpenAI Functions Agent node
使用 OpenAI 函数代理节点,使用 OpenAI 函数模型。这些模型可以检测何时应该调用函数,并返回应该传递给函数的输入。
¥Use the OpenAI Functions Agent node to use an OpenAI functions model. These are models that detect when a function should be called and respond with the inputs that should be passed to the function.
有关 AI Agent 节点本身的更多信息,请参阅 AI 代理。
¥Refer to AI Agent for more information on the AI Agent node itself.
You can use this agent with the Chat Trigger node. Attach a memory sub-node so that users can have an ongoing conversation with multiple queries. Memory doesn't persist between sessions.
OpenAI Chat Model required
你必须将此代理与 OpenAI 聊天模型 一起使用。
¥You must use the OpenAI Chat Model with this agent.
节点参数#
¥Node parameters
使用以下参数配置 OpenAI Functions Agent。
¥Configure the OpenAI Functions Agent using the following parameters.
提示#
¥Prompt
Select how you want the node to construct the prompt (also known as the user's query or input from the chat).
Choose from:
- Take from previous node automatically: If you select this option, the node expects an input from a previous node called
chatInput. - Define below: If you select this option, provide either static text or an expression for dynamic content to serve as the prompt in the Prompt (User Message) field.
要求特定输出格式#
¥Require Specific Output Format
This parameter controls whether you want the node to require a specific output format. When turned on, n8n prompts you to connect one of these output parsers to the node:
节点选项#
¥Node options
使用以下选项优化 OpenAI 函数代理节点的行为:
¥Refine the OpenAI Functions Agent node's behavior using these options:
系统消息#
¥System Message
If you'd like to send a message to the agent before the conversation starts, enter the message you'd like to send.
Use this option to guide the agent's decision-making.
最大迭代次数#
¥Max Iterations
Enter the number of times the model should run to try and generate a good answer from the user's prompt.
Defaults to 10.
返回中间步骤#
¥Return Intermediate Steps
Select whether to include intermediate steps the agent took in the final output (turned on) or not (turned off).
This could be useful for further refining the agent's behavior based on the steps it took.
模板和示例#
¥Templates and examples
请参阅主 AI 代理节点的 模板和示例 部分。
¥Refer to the main AI Agent node's Templates and examples section.
常见问题#
¥Common issues
有关常见问题或建议的解决方案,请参阅 常见问题。
¥For common questions or issues and suggested solutions, refer to Common issues.