ia_rewrite_ntapp 1.0.4 → 1.0.6

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.
Files changed (2) hide show
  1. package/index.js +2 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -81,6 +81,7 @@ async function callModel(config, text) {
81
81
  const model = config.OPENAI_API_MODEL;
82
82
  const apiKey = config.OPENAI_API_KEY;
83
83
  const systemPrompt = config.SYSTEM_PROMPT;
84
+ const timeoutMs = Number(config.OPENAI_TIMEOUT_MS || 300000);
84
85
 
85
86
  const payload = {
86
87
  model,
@@ -97,7 +98,7 @@ async function callModel(config, text) {
97
98
  if (apiKey) headers.Authorization = `Bearer ${apiKey}`;
98
99
 
99
100
  const url = `${baseUrl}/chat/completions`;
100
- const response = await axios.post(url, payload, { headers, timeout: 30000 });
101
+ const response = await axios.post(url, payload, { headers, timeout: timeoutMs });
101
102
  const content = response?.data?.choices?.[0]?.message?.content;
102
103
  if (!content) throw new Error("Resposta vazia da API");
103
104
  return String(content).trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ia_rewrite_ntapp",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "CLI para reescrever texto selecionado via IA",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",