wirejs-resources 0.1.162-llm → 0.1.164
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/config.d.ts +8 -0
- package/dist/config.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/services/llm.js +4 -3
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
package/dist/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/services/llm.js
CHANGED
|
@@ -96,15 +96,16 @@ export class LLM extends Resource {
|
|
|
96
96
|
}
|
|
97
97
|
async continueConversation({ history, onChunk, timeoutSeconds, systemPrompt, targetContextSize, models, tools, }) {
|
|
98
98
|
const ollamaAvailable = await this.checkOllamaAvailable();
|
|
99
|
+
const intendedModels = models ?? this.models;
|
|
99
100
|
if (!ollamaAvailable) {
|
|
100
101
|
return this.createStreamedString('Ollama is not running locally. Please install and start Ollama:\n\n' +
|
|
101
102
|
'1. Visit https://ollama.com/ to download and install Ollama\n' +
|
|
102
103
|
'2. Start Ollama by running: ollama serve\n' +
|
|
103
104
|
'3. Pull a model (e.g., llama2): ollama pull llama2\n\n' +
|
|
104
|
-
'Models
|
|
105
|
+
'Models this request was looking for: ' + intendedModels.join(', '), onChunk);
|
|
105
106
|
}
|
|
106
107
|
// models should be in priority order. so, first one that works is the one we want.
|
|
107
|
-
for (const model of
|
|
108
|
+
for (const model of intendedModels) {
|
|
108
109
|
const modelExists = await this.checkModelExists(model);
|
|
109
110
|
if (!modelExists)
|
|
110
111
|
continue;
|
|
@@ -186,7 +187,7 @@ export class LLM extends Resource {
|
|
|
186
187
|
}
|
|
187
188
|
// if nothing works, we want to tell the user (the dev) how to install the dep.
|
|
188
189
|
return this.createStreamedString('None of the configured models are available. Please ensure Ollama is running and at least one of these models is installed:\n\n' +
|
|
189
|
-
|
|
190
|
+
intendedModels.map(m => `ollama pull ${m}`).join('\n') + '\n\n' +
|
|
190
191
|
'For more information, visit: https://ollama.com/', onChunk);
|
|
191
192
|
}
|
|
192
193
|
}
|