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 CHANGED
@@ -0,0 +1,8 @@
1
+ export type DeploymentConfig = {
2
+ runtimeDesiredMemoryMB?: number;
3
+ runtimeTimeoutSeconds?: number;
4
+ runtimeNodeVersion?: 20 | 22 | 24;
5
+ bundleNodeModules?: string[];
6
+ bundleFormat?: 'cjs' | 'esm';
7
+ bundleMinify?: boolean;
8
+ };
package/dist/config.js CHANGED
@@ -1 +1 @@
1
- "use strict";
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -16,3 +16,4 @@ export * from './resources/key-value-store.js';
16
16
  export * from './resources/endpoint.js';
17
17
  export * from './resources/system-attribute.js';
18
18
  export * from './services/llm.js';
19
+ export * from './config.js';
package/dist/index.js CHANGED
@@ -15,3 +15,4 @@ export * from './resources/key-value-store.js';
15
15
  export * from './resources/endpoint.js';
16
16
  export * from './resources/system-attribute.js';
17
17
  export * from './services/llm.js';
18
+ export * from './config.js';
@@ -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 to try installing: ' + this.models.join(', '), onChunk);
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 models ?? this.models) {
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
- this.models.map(m => `ollama pull ${m}`).join('\n') + '\n\n' +
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-resources",
3
- "version": "0.1.162-llm",
3
+ "version": "0.1.164",
4
4
  "description": "Basic services and server-side resources for wirejs apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",