minerva-cli 0.2.0 → 0.2.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/index.cjs +14 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Command as Command20 } from "commander";
|
|
|
9
9
|
// src/config/constants.ts
|
|
10
10
|
var APP_NAME = "minerva";
|
|
11
11
|
var APP_DESCRIPTION = "Organiza\xE7\xE3o acad\xEAmica para estudantes de ADS da FATEC \u{1F989}";
|
|
12
|
-
var APP_VERSION = "0.2.
|
|
12
|
+
var APP_VERSION = "0.2.1";
|
|
13
13
|
var DEFAULT_VAULT_DIRNAME = "fatec-ads";
|
|
14
14
|
var MATRIZ_URL = "https://fatectq.cps.sp.gov.br/matriz-curricular-ads/";
|
|
15
15
|
|
|
@@ -1230,6 +1230,12 @@ function ollamaProvider() {
|
|
|
1230
1230
|
if (process.env["OLLAMA_API_KEY"]) {
|
|
1231
1231
|
headers["authorization"] = `Bearer ${process.env["OLLAMA_API_KEY"]}`;
|
|
1232
1232
|
}
|
|
1233
|
+
const options = {
|
|
1234
|
+
num_predict: Number(process.env["OLLAMA_MAX_TOKENS"] ?? 1500)
|
|
1235
|
+
};
|
|
1236
|
+
if (process.env["OLLAMA_THREADS"]) {
|
|
1237
|
+
options["num_thread"] = Number(process.env["OLLAMA_THREADS"]);
|
|
1238
|
+
}
|
|
1233
1239
|
return {
|
|
1234
1240
|
name: `ollama (${model} @ ${baseUrl})`,
|
|
1235
1241
|
async generate(prompt, material) {
|
|
@@ -1241,6 +1247,7 @@ function ollamaProvider() {
|
|
|
1241
1247
|
body: JSON.stringify({
|
|
1242
1248
|
model,
|
|
1243
1249
|
stream: false,
|
|
1250
|
+
options,
|
|
1244
1251
|
messages: [
|
|
1245
1252
|
{ role: "system", content: SYSTEM_PROMPT },
|
|
1246
1253
|
{
|
|
@@ -1286,9 +1293,14 @@ async function ollamaDisponivel() {
|
|
|
1286
1293
|
/\/$/,
|
|
1287
1294
|
""
|
|
1288
1295
|
);
|
|
1296
|
+
const headers = {};
|
|
1297
|
+
if (process.env["OLLAMA_API_KEY"]) {
|
|
1298
|
+
headers["authorization"] = `Bearer ${process.env["OLLAMA_API_KEY"]}`;
|
|
1299
|
+
}
|
|
1289
1300
|
try {
|
|
1290
1301
|
const response = await fetch(`${baseUrl}/api/tags`, {
|
|
1291
|
-
|
|
1302
|
+
headers,
|
|
1303
|
+
signal: AbortSignal.timeout(3e3)
|
|
1292
1304
|
});
|
|
1293
1305
|
return response.ok;
|
|
1294
1306
|
} catch {
|