Log in to CometAPI. Click "ADD API key" in the API keys to get your token key: sk-xxxxx
1.
In the FlowiseAI canvas, click Add new. 2.
In the search box, type and search for "cometapi" to find the CometAPI box (i.e., the ChatCometAPI node). 3.
Drag the CometAPI box onto the workspace canvas. 4.
In the Connect Credential dropdown menu of the CometAPI node, select Create New.
5.
Enter the API Key (sk-xxxxx) you obtained from CometAPI.Optional Configuration: Set the Model Name (e.g., gpt-4o-mini), Temperature (e.g., 0.7, to control response randomness), and Additional Parameters (add other parameters as needed).
Step 2: Add Prompt Node and Set Up LLM Chain#
1.
In the + (Add Nodes) menu, search for "Prompt", then find and select the Prompt Template node. 2.
Drag the Prompt Template node onto the workspace canvas. 3.
In the Prompt Template node, set up the prompt template, for example:Question: {question}
Answer: Let's think step by step.
This will create a basic prompt structure to guide the model's response. 4.
Next, set up the chain model:In the + (Add Nodes) menu, search for "Chain", then find and select the LLM Chain node. Drag the LLM Chain node onto the workspace canvas.
Language Model: Select or connect to the CometAPI node from Step 1.
Prompt: This will be connected to the Prompt Template node later.
Output Parser: Optional, used to parse the output format.
Chain Name: Enter a name for your chain, for example, "Universal Chat Assistant".
Input Moderation: Optional, enable input checks for safety.
Step 3: Connect Nodes and Complete the Flow#
1.
Connect the created template nodes:Connect the CometAPI node to the Language Model input of the LLM Chain.
Connect the Prompt Template node to the Prompt input of the LLM Chain.
Ensure the nodes form a complete chain flow: Input → Prompt Template → LLM Chain → Output.
2.
With these connections, the universal chat assistant is now set up. The canvas will display a simple chain structure that supports basic queries and response generation.
Troubleshooting#
Cannot find the "cometapi" node: Ensure your FlowiseAI version supports this integration. Check for FlowiseAI updates or relevant plugins.
Credential configuration failed: Verify that the API Key is correct (copied from the CometAPI console) and has not expired.
Node connection error: Make sure the connection lines are correctly pointed to the Language Model and Prompt inputs. If the response is not ideal, adjust the Prompt Template or Temperature parameter.
Summary#
With this guide, you can quickly integrate CometAPI into FlowiseAI to build an efficient universal chat assistant. This process, based on drag-and-drop nodes and chain orchestration, is suitable for scenarios like customer service bots and Q&A systems. For extensions (such as adding document loaders or multi-turn conversation support), please refer to the official FlowiseAI documentation.If you have any questions, feel free to consult the CometAPI documentation or the FlowiseAI community.Modified at 2025-10-20 07:39:22