n8n-nodes-caedral 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -46
- package/dist/nodes/Caedral/Caedral.node.d.ts +0 -31
- package/dist/nodes/Caedral/Caedral.node.js +280 -98
- package/dist/nodes/Caedral/Caedral.node.js.map +1 -1
- package/dist/nodes/Caedral/Caedral.node.json +5 -2
- package/dist/nodes/Caedral/helpers.d.ts +1 -0
- package/dist/nodes/Caedral/helpers.js +3 -0
- package/dist/nodes/Caedral/helpers.js.map +1 -1
- package/dist/nodes/CaedralChatModel/CaedralChatModel.node.d.ts +10 -0
- package/dist/nodes/CaedralChatModel/CaedralChatModel.node.js +182 -0
- package/dist/nodes/CaedralChatModel/CaedralChatModel.node.js.map +1 -0
- package/dist/nodes/CaedralChatModel/CaedralChatModel.node.json +16 -0
- package/dist/nodes/CaedralEmbeddings/CaedralEmbeddings.node.d.ts +10 -0
- package/dist/nodes/CaedralEmbeddings/CaedralEmbeddings.node.js +114 -0
- package/dist/nodes/CaedralEmbeddings/CaedralEmbeddings.node.js.map +1 -0
- package/dist/nodes/CaedralEmbeddings/CaedralEmbeddings.node.json +16 -0
- package/dist/nodes/CaedralReranker/CaedralReranker.node.d.ts +10 -0
- package/dist/nodes/CaedralReranker/CaedralReranker.node.js +126 -0
- package/dist/nodes/CaedralReranker/CaedralReranker.node.js.map +1 -0
- package/dist/nodes/CaedralReranker/CaedralReranker.node.json +16 -0
- package/dist/nodes/CaedralTrigger/CaedralTrigger.node.d.ts +9 -0
- package/dist/nodes/CaedralTrigger/CaedralTrigger.node.js +145 -0
- package/dist/nodes/CaedralTrigger/CaedralTrigger.node.js.map +1 -0
- package/dist/nodes/CaedralTrigger/CaedralTrigger.node.json +13 -0
- package/package.json +15 -4
package/README.md
CHANGED
|
@@ -1,92 +1,138 @@
|
|
|
1
1
|
# n8n-nodes-caedral
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Community node for [n8n](https://n8n.io/) that integrates with [Caedral AI](https://caedral.com) — unified access to frontier and proprietary AI models through one API.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
In your n8n instance:
|
|
8
|
+
|
|
9
|
+
1. Go to **Settings → Community Nodes**
|
|
10
|
+
2. Enter `n8n-nodes-caedral`
|
|
11
|
+
3. Click **Install**
|
|
12
|
+
|
|
13
|
+
Or via CLI:
|
|
8
14
|
|
|
9
15
|
```bash
|
|
10
|
-
cd ~/.n8n
|
|
16
|
+
cd ~/.n8n
|
|
11
17
|
npm install n8n-nodes-caedral
|
|
12
|
-
# Restart n8n
|
|
13
18
|
```
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
## Nodes
|
|
16
21
|
|
|
17
|
-
|
|
18
|
-
cd n8n-nodes-caedral
|
|
19
|
-
npm install && npm run build
|
|
20
|
-
npm link
|
|
21
|
-
cd ~/.n8n/custom && npm link n8n-nodes-caedral
|
|
22
|
-
```
|
|
22
|
+
### Caedral (Main Node)
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Full-featured node with 8 operations covering all Caedral API capabilities:
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
| Operation | Description |
|
|
27
|
+
|-----------|-------------|
|
|
28
|
+
| **Chat Completion** | Send messages to any Caedral model tier (Base, Titan, Olympus, Primordial) with system prompts, temperature, and max tokens |
|
|
29
|
+
| **Generate Image** | Create images from text prompts using Caedral Vision (1024×1024, 1792×1024, 1024×1792) |
|
|
30
|
+
| **Create Embedding** | Generate vector embeddings for text or arrays of texts using Caedral Embed |
|
|
31
|
+
| **Generate Audio** | Convert text to speech with voice selection (alloy, echo, fable, onyx, nova, shimmer) |
|
|
32
|
+
| **Rerank** | Semantically rerank documents by relevance to a query using Caedral Rerank |
|
|
33
|
+
| **List Models** | Retrieve all available models (chat + specialized) |
|
|
34
|
+
| **Get Usage** | Check pool balance, weekly usage, and overage status |
|
|
35
|
+
| **Get Account Info** | View account status, plan details, and billing information |
|
|
27
36
|
|
|
28
|
-
|
|
29
|
-
|-------|-------------|
|
|
30
|
-
| API Key | Your `cd_live_...` key from [Dashboard → API Keys](https://caedral.com/dashboard/api-keys) |
|
|
31
|
-
| Base URL | `https://api.caedral.com` (production) or `http://localhost:5001` (local gateway) |
|
|
37
|
+
### Caedral Chat Model (AI Sub-Node)
|
|
32
38
|
|
|
33
|
-
|
|
39
|
+
An AI Language Model node that plugs directly into n8n's native **AI Agent** and **Chain** nodes. Connect it as the language model input to instantly power your AI workflows with Caedral.
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
- Select model tier (Base/Titan/Olympus/Primordial)
|
|
42
|
+
- Configure temperature and max tokens
|
|
43
|
+
- Compatible with all n8n AI Agent patterns
|
|
36
44
|
|
|
37
|
-
###
|
|
45
|
+
### Caedral Trigger (Polling)
|
|
38
46
|
|
|
39
|
-
|
|
47
|
+
Automatically trigger workflows based on account conditions:
|
|
40
48
|
|
|
41
|
-
|
|
49
|
+
- **Balance Below Threshold** — fires when your balance in cents drops below a configured amount
|
|
50
|
+
- **Pool Usage Above Percentage** — fires when weekly pool usage exceeds a percentage threshold
|
|
42
51
|
|
|
43
|
-
|
|
44
|
-
- **Messages** — JSON array or individual role/content fields
|
|
45
|
-
- **Temperature**, **Max Tokens** — optional generation parameters
|
|
52
|
+
Polling interval configurable in n8n's trigger settings.
|
|
46
53
|
|
|
47
|
-
|
|
54
|
+
## Credentials
|
|
48
55
|
|
|
49
|
-
|
|
56
|
+
Create a **Caedral API** credential with:
|
|
50
57
|
|
|
51
|
-
|
|
58
|
+
| Field | Description |
|
|
59
|
+
|-------|-------------|
|
|
60
|
+
| **API Key** | Your `cd_live_...` key from the [Caedral dashboard](https://caedral.com/dashboard/api-keys) |
|
|
61
|
+
| **Base URL** | Default: `https://api.caedral.com`. Use `http://localhost:5001` for local development |
|
|
52
62
|
|
|
53
|
-
|
|
63
|
+
The credential is validated by calling `GET /v1/usage` on save.
|
|
54
64
|
|
|
55
|
-
|
|
56
|
-
2. **IF** — continue only if balance is sufficient
|
|
57
|
-
3. **Chat Completion** — run inference with `caedral-olympus`
|
|
58
|
-
4. Send output to Slack, email, or downstream nodes
|
|
65
|
+
## Models
|
|
59
66
|
|
|
60
|
-
|
|
67
|
+
### Chat Models (for Chat Completion & AI Agent)
|
|
61
68
|
|
|
62
|
-
|
|
69
|
+
| Model ID | Tier | Use Case |
|
|
70
|
+
|----------|------|----------|
|
|
71
|
+
| `caedral-base` | Free | Prototyping, everyday tasks |
|
|
72
|
+
| `caedral-titan` | Efficient | High-volume production |
|
|
73
|
+
| `caedral-olympus` | Balanced | Complex agentic applications |
|
|
74
|
+
| `caedral-primordial` | Frontier | Research, mission-critical |
|
|
63
75
|
|
|
64
|
-
|
|
76
|
+
### Specialized Models
|
|
65
77
|
|
|
66
|
-
|
|
67
|
-
|
|
78
|
+
| Model ID | Modality | Pricing |
|
|
79
|
+
|----------|----------|---------|
|
|
80
|
+
| `caedral-vision` | Image generation | ~$3.50/M tokens |
|
|
81
|
+
| `caedral-embed` | Text embeddings | ~$0.18/M tokens |
|
|
82
|
+
| `caedral-voice` | Audio/speech | ~$0.84/M tokens |
|
|
83
|
+
| `caedral-rerank` | Semantic reranking | ~$0.35/request |
|
|
68
84
|
|
|
69
|
-
|
|
85
|
+
## Example Workflows
|
|
86
|
+
|
|
87
|
+
### AI Agent with Caedral
|
|
88
|
+
|
|
89
|
+
1. Add an **AI Agent** node
|
|
90
|
+
2. Connect a **Caedral Chat Model** node as the Language Model input
|
|
91
|
+
3. Select your preferred model tier (e.g., Olympus for balanced performance)
|
|
92
|
+
4. Add tools (HTTP Request, Code, etc.) to the agent
|
|
93
|
+
|
|
94
|
+
### Low Balance Alert
|
|
95
|
+
|
|
96
|
+
1. Add a **Caedral Trigger** node
|
|
97
|
+
2. Set condition to "Balance Below Threshold"
|
|
98
|
+
3. Set threshold to 1000 (= $10.00)
|
|
99
|
+
4. Connect to a Slack/Email notification node
|
|
100
|
+
|
|
101
|
+
### Document Embedding Pipeline
|
|
102
|
+
|
|
103
|
+
1. Trigger: new documents arrive
|
|
104
|
+
2. **Caedral** node → Create Embedding operation
|
|
105
|
+
3. Store embeddings in your vector database
|
|
70
106
|
|
|
71
107
|
## Development
|
|
72
108
|
|
|
73
109
|
```bash
|
|
110
|
+
git clone https://github.com/caedral/n8n-nodes-caedral.git
|
|
111
|
+
cd n8n-nodes-caedral
|
|
74
112
|
npm install
|
|
75
113
|
npm run build
|
|
76
114
|
npm test
|
|
77
115
|
```
|
|
78
116
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
## Publishing
|
|
117
|
+
### Project Structure
|
|
82
118
|
|
|
83
|
-
|
|
119
|
+
```
|
|
120
|
+
├── credentials/ # API credential type
|
|
121
|
+
├── nodes/
|
|
122
|
+
│ ├── Caedral/ # Main multi-operation node
|
|
123
|
+
│ ├── CaedralChatModel/ # AI Agent sub-node
|
|
124
|
+
│ └── CaedralTrigger/ # Polling trigger node
|
|
125
|
+
├── shared/ # Constants and utilities
|
|
126
|
+
├── tests/ # Integration tests
|
|
127
|
+
└── icons/ # Node icons (light + dark)
|
|
128
|
+
```
|
|
84
129
|
|
|
85
130
|
## Links
|
|
86
131
|
|
|
87
|
-
- [Caedral
|
|
88
|
-
- [
|
|
89
|
-
- [
|
|
132
|
+
- [Caedral Documentation](https://caedral.com/docs)
|
|
133
|
+
- [API Reference](https://caedral.com/docs/api-reference)
|
|
134
|
+
- [n8n Integration Guide](https://caedral.com/docs/n8n-overview)
|
|
135
|
+
- [Report Issues](https://github.com/caedral/n8n-nodes-caedral/issues)
|
|
90
136
|
|
|
91
137
|
## License
|
|
92
138
|
|
|
@@ -1,36 +1,5 @@
|
|
|
1
1
|
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from "n8n-workflow";
|
|
2
|
-
/**
|
|
3
|
-
* n8n node exposing the Caedral API.
|
|
4
|
-
*
|
|
5
|
-
* Supports two operations:
|
|
6
|
-
* - `chatCompletion` — send a chat completion request to a Caedral
|
|
7
|
-
* model, either with a single simple message or a full JSON
|
|
8
|
-
* messages array.
|
|
9
|
-
* - `getUsage` — fetch the account's current pool, balance, and
|
|
10
|
-
* overage status.
|
|
11
|
-
*
|
|
12
|
-
* Requests are authenticated using the `caedralApi` credentials
|
|
13
|
-
* (API key + optional base URL override).
|
|
14
|
-
*/
|
|
15
2
|
export declare class Caedral implements INodeType {
|
|
16
3
|
description: INodeTypeDescription;
|
|
17
|
-
/**
|
|
18
|
-
* Execute the node for every input item.
|
|
19
|
-
*
|
|
20
|
-
* For each item, resolves the selected `operation` and dispatches
|
|
21
|
-
* the corresponding Caedral API call. On success, the response is
|
|
22
|
-
* normalized into a flat JSON object and pushed to the output.
|
|
23
|
-
*
|
|
24
|
-
* When "Continue On Fail" is enabled, per-item errors are captured
|
|
25
|
-
* as `{ error: string }` entries in the output; otherwise the
|
|
26
|
-
* error is re-thrown (wrapped in `NodeOperationError` if it is not
|
|
27
|
-
* already a node error).
|
|
28
|
-
*
|
|
29
|
-
* @returns A single-branch array of output items, one per input.
|
|
30
|
-
* @throws {NodeApiError} If the Caedral API returns a non-2xx
|
|
31
|
-
* status and "Continue On Fail" is disabled.
|
|
32
|
-
* @throws {NodeOperationError} For validation or unknown-operation
|
|
33
|
-
* errors, or when wrapping an unexpected runtime error.
|
|
34
|
-
*/
|
|
35
4
|
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
36
5
|
}
|