@aiteza/n8n-nodes-aiteza 0.3.0 → 0.3.1
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/dist/nodes/Aiteza/Aiteza.node.js +35 -10
- package/package.json +1 -1
|
@@ -1400,7 +1400,7 @@ class Aiteza {
|
|
|
1400
1400
|
typeOptions: { loadOptionsMethod: 'getDatarooms' },
|
|
1401
1401
|
default: [],
|
|
1402
1402
|
displayOptions: { show: { resource: ['search'], operation: ['hybridSearch'] } },
|
|
1403
|
-
description: 'Datarooms to search across. Choose from the list (prepopulated with recently used), or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
1403
|
+
description: 'Datarooms to search across. Can be empty for standalone file/image workflows. Choose from the list (prepopulated with recently used), or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
1404
1404
|
},
|
|
1405
1405
|
{
|
|
1406
1406
|
displayName: 'Additional Fields',
|
|
@@ -1443,6 +1443,20 @@ class Aiteza {
|
|
|
1443
1443
|
default: 0,
|
|
1444
1444
|
description: 'Maximum number of tokens in result set (0 = no limit)',
|
|
1445
1445
|
},
|
|
1446
|
+
{
|
|
1447
|
+
displayName: 'File IDs',
|
|
1448
|
+
name: 'fileIds',
|
|
1449
|
+
type: 'string',
|
|
1450
|
+
default: '',
|
|
1451
|
+
description: 'Comma-separated list of standalone file IDs to include in the search scope. Used when files are attached directly (e.g., in workflow executions) without a dataroom.',
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
displayName: 'Image IDs',
|
|
1455
|
+
name: 'imageIds',
|
|
1456
|
+
type: 'string',
|
|
1457
|
+
default: '',
|
|
1458
|
+
description: 'Comma-separated list of standalone image IDs to include in the search scope. Used when images are attached directly (e.g., in workflow executions) without a dataroom.',
|
|
1459
|
+
},
|
|
1446
1460
|
],
|
|
1447
1461
|
},
|
|
1448
1462
|
// ==================================================================
|
|
@@ -1509,6 +1523,7 @@ class Aiteza {
|
|
|
1509
1523
|
async execute() {
|
|
1510
1524
|
const items = this.getInputData();
|
|
1511
1525
|
const returnData = [];
|
|
1526
|
+
const CHAT_REQUEST_TIMEOUT_MS = 20 * 60 * 1000;
|
|
1512
1527
|
const resource = this.getNodeParameter('resource', 0);
|
|
1513
1528
|
const operation = this.getNodeParameter('operation', 0);
|
|
1514
1529
|
const authMode = this.getNodeParameter('authSource', 0, 'credentials');
|
|
@@ -2013,40 +2028,40 @@ class Aiteza {
|
|
|
2013
2028
|
else if (resource === 'chat') {
|
|
2014
2029
|
if (operation === 'create') {
|
|
2015
2030
|
const chatName = this.getNodeParameter('chatName', i, '');
|
|
2016
|
-
responseData = await apiReq('POST', '/api/chat', chatName ? { name: chatName } : {});
|
|
2031
|
+
responseData = await apiReq('POST', '/api/chat', chatName ? { name: chatName } : {}, {}, { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
2017
2032
|
}
|
|
2018
2033
|
else if (operation === 'get') {
|
|
2019
2034
|
const chatId = this.getNodeParameter('chatId', i);
|
|
2020
|
-
responseData = await apiReq('GET', `/api/chat/${chatId}
|
|
2035
|
+
responseData = await apiReq('GET', `/api/chat/${chatId}`, {}, {}, { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
2021
2036
|
}
|
|
2022
2037
|
else if (operation === 'getMany') {
|
|
2023
|
-
responseData = await apiReq('GET', '/api/chat', {}, buildPaginationQs(i));
|
|
2038
|
+
responseData = await apiReq('GET', '/api/chat', {}, buildPaginationQs(i), { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
2024
2039
|
}
|
|
2025
2040
|
else if (operation === 'getMessages') {
|
|
2026
2041
|
const chatId = this.getNodeParameter('chatId', i);
|
|
2027
|
-
responseData = await apiReq('GET', `/api/chat/${chatId}/messages
|
|
2042
|
+
responseData = await apiReq('GET', `/api/chat/${chatId}/messages`, {}, {}, { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
2028
2043
|
}
|
|
2029
2044
|
else if (operation === 'getMessage') {
|
|
2030
2045
|
const chatId = this.getNodeParameter('chatId', i);
|
|
2031
2046
|
const messageId = this.getNodeParameter('messageId', i);
|
|
2032
|
-
responseData = await apiReq('GET', `/api/chat/${chatId}/messages/${messageId}
|
|
2047
|
+
responseData = await apiReq('GET', `/api/chat/${chatId}/messages/${messageId}`, {}, {}, { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
2033
2048
|
}
|
|
2034
2049
|
else if (operation === 'getLatestMessage') {
|
|
2035
2050
|
const chatId = this.getNodeParameter('chatId', i);
|
|
2036
|
-
responseData = await apiReq('GET', `/api/chat/${chatId}/messages/latest
|
|
2051
|
+
responseData = await apiReq('GET', `/api/chat/${chatId}/messages/latest`, {}, {}, { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
2037
2052
|
}
|
|
2038
2053
|
else if (operation === 'delete') {
|
|
2039
2054
|
const chatId = this.getNodeParameter('chatId', i);
|
|
2040
|
-
responseData = await apiReq('DELETE', `/api/chat/${chatId}
|
|
2055
|
+
responseData = await apiReq('DELETE', `/api/chat/${chatId}`, {}, {}, { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
2041
2056
|
}
|
|
2042
2057
|
else if (operation === 'deleteMessages') {
|
|
2043
2058
|
const chatId = this.getNodeParameter('chatId', i);
|
|
2044
|
-
responseData = await apiReq('DELETE', `/api/chat/${chatId}/messages
|
|
2059
|
+
responseData = await apiReq('DELETE', `/api/chat/${chatId}/messages`, {}, {}, { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
2045
2060
|
}
|
|
2046
2061
|
else if (operation === 'rename') {
|
|
2047
2062
|
const chatId = this.getNodeParameter('chatId', i);
|
|
2048
2063
|
const newName = this.getNodeParameter('newName', i);
|
|
2049
|
-
responseData = await apiReq('PATCH', `/api/chat/${chatId}`, { name: newName });
|
|
2064
|
+
responseData = await apiReq('PATCH', `/api/chat/${chatId}`, { name: newName }, {}, { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
2050
2065
|
}
|
|
2051
2066
|
else if (operation === 'generate') {
|
|
2052
2067
|
const chatId = this.getNodeParameter('chatId', i);
|
|
@@ -2072,6 +2087,7 @@ class Aiteza {
|
|
|
2072
2087
|
method: 'POST',
|
|
2073
2088
|
url: `${baseUrl}/api/chat/${chatId}/generate`,
|
|
2074
2089
|
body: form,
|
|
2090
|
+
timeout: CHAT_REQUEST_TIMEOUT_MS,
|
|
2075
2091
|
returnFullResponse: true,
|
|
2076
2092
|
});
|
|
2077
2093
|
responseData = typeof response === 'object' && response.body !== undefined ? response.body : response;
|
|
@@ -2103,6 +2119,7 @@ class Aiteza {
|
|
|
2103
2119
|
method: 'POST',
|
|
2104
2120
|
url: `${baseUrl}/api/chat/estimate`,
|
|
2105
2121
|
body: form,
|
|
2122
|
+
timeout: CHAT_REQUEST_TIMEOUT_MS,
|
|
2106
2123
|
});
|
|
2107
2124
|
}
|
|
2108
2125
|
else if (operation === 'tempChat') {
|
|
@@ -2128,6 +2145,7 @@ class Aiteza {
|
|
|
2128
2145
|
method: 'POST',
|
|
2129
2146
|
url: `${baseUrl}/api/chat/temp`,
|
|
2130
2147
|
body: form,
|
|
2148
|
+
timeout: CHAT_REQUEST_TIMEOUT_MS,
|
|
2131
2149
|
});
|
|
2132
2150
|
if (typeof responseData === 'string') {
|
|
2133
2151
|
responseData = { result: responseData };
|
|
@@ -2167,6 +2185,13 @@ class Aiteza {
|
|
|
2167
2185
|
if (additionalFields.maxTokens && additionalFields.maxTokens > 0) {
|
|
2168
2186
|
body.maxTokens = additionalFields.maxTokens;
|
|
2169
2187
|
}
|
|
2188
|
+
for (const key of ['fileIds', 'imageIds']) {
|
|
2189
|
+
if (additionalFields[key] !== undefined && additionalFields[key] !== '') {
|
|
2190
|
+
const ids = toIdArray(additionalFields[key]);
|
|
2191
|
+
if (ids.length > 0)
|
|
2192
|
+
body[key] = ids;
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
2170
2195
|
responseData = await apiReq('POST', '/api/dataroom/search', body);
|
|
2171
2196
|
}
|
|
2172
2197
|
}
|