garriga 1.0.2 → 1.0.4
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/index.js +7 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -40,10 +40,8 @@ class LLMAdapter {
|
|
|
40
40
|
class ChatGptAPI {
|
|
41
41
|
constructor() {
|
|
42
42
|
this.apiKey = process.env.CHATGPTAPIKEY;
|
|
43
|
-
this.apiUrl =
|
|
44
|
-
|
|
45
|
-
"https://api.openai.com/v1/chat/completions";
|
|
46
|
-
this.model = process.env.CHATGPTMODEL || "gpt-3.5-turbo";
|
|
43
|
+
this.apiUrl = "https://api.openai.com/v1/chat/completions";
|
|
44
|
+
this.model = "gpt-3.5-turbo";
|
|
47
45
|
}
|
|
48
46
|
async generateResponse(prompt) {
|
|
49
47
|
try {
|
|
@@ -108,7 +106,6 @@ class GeminiAPI {
|
|
|
108
106
|
constructor() {
|
|
109
107
|
this.apiKey = process.env.GEMINIAPIKEY;
|
|
110
108
|
this.baseURL =
|
|
111
|
-
process.env.GEMINIURLBASE ||
|
|
112
109
|
"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent";
|
|
113
110
|
}
|
|
114
111
|
|
|
@@ -207,7 +204,11 @@ class localLLM {
|
|
|
207
204
|
}
|
|
208
205
|
}
|
|
209
206
|
|
|
210
|
-
async generateResponse(
|
|
207
|
+
async generateResponse(
|
|
208
|
+
prompt,
|
|
209
|
+
userToken,
|
|
210
|
+
source = process.env.LOCALMODEL || "mistral7b-genei:latest",
|
|
211
|
+
) {
|
|
211
212
|
if (userToken === "modeloLocalOllama") {
|
|
212
213
|
try {
|
|
213
214
|
const response = await axios.post(
|