OpenAI Functions Agent
Last updated
Was this helpful?
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.
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
You must use the OpenAI Chat Model with this agent.
Configure the OpenAI Functions Agent using the following parameters.
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.
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:
Refine the OpenAI Functions Agent node's behavior using these options:
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.
Enter the number of times the model should run to try and generate a good answer from the user's prompt.
Defaults to 10.
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.
Add custom key-value metadata to tracing events for this agent. This is useful for filtering and debugging runs in tracing tools like LangSmith.
Entries with empty keys or values are ignored.
Refer to the main AI Agent node's Templates and examples section.
For common questions or issues and suggested solutions, refer to Common issues.
Last updated
Was this helpful?
Was this helpful?