@aiteza/n8n-nodes-aiteza 1.0.0 → 1.0.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.
@@ -1854,6 +1854,14 @@ class Aiteza {
1854
1854
  default: [],
1855
1855
  description: 'Datarooms to use as context. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
1856
1856
  },
1857
+ {
1858
+ displayName: 'Timeout (Minutes)',
1859
+ name: 'timeoutMinutes',
1860
+ type: 'number',
1861
+ default: 60,
1862
+ typeOptions: { minValue: 1 },
1863
+ description: 'Maximum time in minutes to wait for the AI response. Increase for complex or long-running queries.',
1864
+ },
1857
1865
  {
1858
1866
  displayName: 'File IDs',
1859
1867
  name: 'fileIds',
@@ -1946,6 +1954,14 @@ class Aiteza {
1946
1954
  default: [],
1947
1955
  description: 'Datarooms to search for context. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
1948
1956
  },
1957
+ {
1958
+ displayName: 'Timeout (Minutes)',
1959
+ name: 'timeoutMinutes',
1960
+ type: 'number',
1961
+ default: 60,
1962
+ typeOptions: { minValue: 1 },
1963
+ description: 'Maximum time in minutes to wait for the AI response. Increase for complex or long-running queries.',
1964
+ },
1949
1965
  {
1950
1966
  displayName: 'File IDs',
1951
1967
  name: 'fileIds',
@@ -2216,7 +2232,7 @@ class Aiteza {
2216
2232
  async execute() {
2217
2233
  const items = this.getInputData();
2218
2234
  const returnData = [];
2219
- const CHAT_REQUEST_TIMEOUT_MS = 20 * 60 * 1000;
2235
+ const CHAT_REQUEST_TIMEOUT_MS = 60 * 60 * 1000;
2220
2236
  const resource = this.getNodeParameter('resource', 0);
2221
2237
  const operation = this.getNodeParameter('operation', 0);
2222
2238
  const authMode = this.getNodeParameter('authSource', 0, 'credentials');
@@ -2853,6 +2869,9 @@ class Aiteza {
2853
2869
  const prompt = this.getNodeParameter('prompt', i);
2854
2870
  const model = this.getNodeParameter('model', i);
2855
2871
  const additionalFields = this.getNodeParameter('additionalFields', i, {});
2872
+ const timeoutMs = additionalFields.timeoutMinutes
2873
+ ? additionalFields.timeoutMinutes * 60 * 1000
2874
+ : CHAT_REQUEST_TIMEOUT_MS;
2856
2875
  const form = new form_data_1.default();
2857
2876
  form.append('prompt', prompt);
2858
2877
  form.append('model', model);
@@ -2877,7 +2896,7 @@ class Aiteza {
2877
2896
  method: 'POST',
2878
2897
  url: `${baseUrl}/api/chat/${chatId}/generate`,
2879
2898
  body: form,
2880
- timeout: CHAT_REQUEST_TIMEOUT_MS,
2899
+ timeout: timeoutMs,
2881
2900
  returnFullResponse: true,
2882
2901
  });
2883
2902
  responseData =
@@ -2893,6 +2912,9 @@ class Aiteza {
2893
2912
  const prompt = this.getNodeParameter('prompt', i);
2894
2913
  const model = this.getNodeParameter('model', i);
2895
2914
  const additionalFields = this.getNodeParameter('additionalFields', i, {});
2915
+ const timeoutMs = additionalFields.timeoutMinutes
2916
+ ? additionalFields.timeoutMinutes * 60 * 1000
2917
+ : CHAT_REQUEST_TIMEOUT_MS;
2896
2918
  const form = new form_data_1.default();
2897
2919
  form.append('prompt', prompt);
2898
2920
  form.append('model', model);
@@ -2917,13 +2939,16 @@ class Aiteza {
2917
2939
  method: 'POST',
2918
2940
  url: `${baseUrl}/api/chat/estimate`,
2919
2941
  body: form,
2920
- timeout: CHAT_REQUEST_TIMEOUT_MS,
2942
+ timeout: timeoutMs,
2921
2943
  });
2922
2944
  }
2923
2945
  else if (operation === 'tempChat') {
2924
2946
  const prompt = this.getNodeParameter('prompt', i);
2925
2947
  const model = this.getNodeParameter('model', i);
2926
2948
  const additionalFields = this.getNodeParameter('additionalFields', i, {});
2949
+ const timeoutMs = additionalFields.timeoutMinutes
2950
+ ? additionalFields.timeoutMinutes * 60 * 1000
2951
+ : CHAT_REQUEST_TIMEOUT_MS;
2927
2952
  const form = new form_data_1.default();
2928
2953
  form.append('prompt', prompt);
2929
2954
  form.append('model', model);
@@ -2948,7 +2973,7 @@ class Aiteza {
2948
2973
  method: 'POST',
2949
2974
  url: `${baseUrl}/api/chat/temp`,
2950
2975
  body: form,
2951
- timeout: CHAT_REQUEST_TIMEOUT_MS,
2976
+ timeout: timeoutMs,
2952
2977
  });
2953
2978
  if (typeof responseData === 'string') {
2954
2979
  responseData = { result: responseData };
@@ -2977,8 +3002,7 @@ class Aiteza {
2977
3002
  const additionalFields = this.getNodeParameter('additionalFields', i, {});
2978
3003
  const body = { query };
2979
3004
  const dataroomIds = toIdArray(dataroomIdsRaw);
2980
- if (dataroomIds.length > 0)
2981
- body.dataroomIds = dataroomIds;
3005
+ body.dataroomIds = dataroomIds;
2982
3006
  for (const key of [
2983
3007
  'topK',
2984
3008
  'vectorThreshold',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiteza/n8n-nodes-aiteza",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "n8n Community Node for the AITEZA REST API (Datarooms, Files, Chat, Search, Workflows)",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",