@elizaos/plugin-ollama 2.0.0-alpha.4 → 2.0.0-alpha.537

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Shaw Walters and elizaOS Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,161 @@
1
+ # Ollama Plugin
2
+
3
+ This plugin provides integration with [Ollama](https://ollama.com/)'s local models through the ElizaOS platform. It allows you to leverage locally running LLMs for text generation, embeddings, and object generation.
4
+
5
+ ## Overview
6
+
7
+ Ollama enables running large language models locally on your machine. This plugin connects ElizaOS with your local Ollama installation, giving your characters access to powerful language models running on your own hardware.
8
+
9
+ ## Requirements
10
+
11
+ - [Ollama](https://ollama.com/) installed and running on your system
12
+ - ElizaOS platform
13
+ - At least one Ollama model pulled and available (e.g., `llama3`, `gemma3:latest`)
14
+
15
+ ## Installation
16
+
17
+ 1. Install this plugin in your ElizaOS project:
18
+
19
+ ```bash
20
+ bun add @elizaos/plugin-ollama
21
+ ```
22
+
23
+ 2. Make sure Ollama is running:
24
+ ```bash
25
+ ollama serve
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ Add the plugin to your character configuration:
31
+
32
+ ```json
33
+ "plugins": ["@elizaos/plugin-ollama"]
34
+ ```
35
+
36
+ ## Configuration
37
+
38
+ The plugin requires these environment variables (can be set in .env file or character settings):
39
+
40
+ ```json
41
+ "settings": {
42
+ "OLLAMA_API_ENDPOINT": "http://localhost:11434/api",
43
+ "OLLAMA_SMALL_MODEL": "gemma3:latest",
44
+ "OLLAMA_MEDIUM_MODEL": "gemma3:latest",
45
+ "OLLAMA_LARGE_MODEL": "gemma3:latest",
46
+ "OLLAMA_EMBEDDING_MODEL": "nomic-embed-text:latest"
47
+ }
48
+ ```
49
+
50
+ Or in `.env` file:
51
+
52
+ ```
53
+ OLLAMA_API_ENDPOINT=http://localhost:11434/api
54
+ OLLAMA_SMALL_MODEL=gemma3:latest
55
+ OLLAMA_MEDIUM_MODEL=gemma3:latest
56
+ OLLAMA_LARGE_MODEL=gemma3:latest
57
+ OLLAMA_EMBEDDING_MODEL=nomic-embed-text:latest
58
+ ```
59
+
60
+ ### Configuration Options
61
+
62
+ - `OLLAMA_API_ENDPOINT`: Ollama API endpoint (default: http://localhost:11434/api)
63
+ - `OLLAMA_SMALL_MODEL`: Model for simpler tasks (default: gemma3:latest)
64
+ - `OLLAMA_MEDIUM_MODEL`: Medium-complexity model (default: gemma3:latest)
65
+ - `OLLAMA_LARGE_MODEL`: Model for complex tasks (default: gemma3:latest)
66
+ - `OLLAMA_EMBEDDING_MODEL`: Model for text embeddings (default: nomic-embed-text:latest)
67
+
68
+ The plugin provides these model classes:
69
+
70
+ - `TEXT_SMALL`: Optimized for fast responses with simpler prompts
71
+ - `TEXT_LARGE`: For complex tasks requiring deeper reasoning
72
+ - `TEXT_EMBEDDING`: Text embedding model
73
+ - `OBJECT_SMALL`: JSON object generation with simpler models
74
+ - `OBJECT_LARGE`: JSON object generation with more complex models
75
+
76
+ ## API Reference
77
+
78
+ For detailed information about the Ollama API used by this plugin, refer to the [official Ollama API documentation](https://github.com/ollama/ollama/blob/main/docs/api.md).
79
+
80
+ ## Features
81
+
82
+ ### Text Generation (Small Model)
83
+
84
+ Generate text using smaller, faster models optimized for quick responses:
85
+
86
+ ```js
87
+ const text = await runtime.useModel(ModelType.TEXT_SMALL, {
88
+ prompt: "What is the nature of reality?",
89
+ stopSequences: [], // optional
90
+ });
91
+ ```
92
+
93
+ ### Text Generation (Large Model)
94
+
95
+ Generate comprehensive text responses using more powerful models for complex tasks:
96
+
97
+ ```js
98
+ const text = await runtime.useModel(ModelType.TEXT_LARGE, {
99
+ prompt: "Write a detailed explanation of quantum physics",
100
+ stopSequences: [], // optional
101
+ maxTokens: 8192, // optional (default: 8192)
102
+ temperature: 0.7, // optional (default: 0.7)
103
+ frequencyPenalty: 0.7, // optional (default: 0.7)
104
+ presencePenalty: 0.7, // optional (default: 0.7)
105
+ });
106
+ ```
107
+
108
+ ### Text Embeddings
109
+
110
+ Generate vector embeddings for text, which can be used for semantic search or other vector operations:
111
+
112
+ ```js
113
+ const embedding = await runtime.useModel(ModelType.TEXT_EMBEDDING, {
114
+ text: "Text to embed",
115
+ });
116
+ // or
117
+ const embedding = await runtime.useModel(
118
+ ModelType.TEXT_EMBEDDING,
119
+ "Text to embed",
120
+ );
121
+ ```
122
+
123
+ ### Object Generation (Small Model)
124
+
125
+ Generate structured JSON objects using faster models:
126
+
127
+ ```js
128
+ const object = await runtime.useModel(ModelType.OBJECT_SMALL, {
129
+ prompt: "Generate a JSON object representing a user profile",
130
+ temperature: 0.7, // optional
131
+ });
132
+ ```
133
+
134
+ ### Object Generation (Large Model)
135
+
136
+ Generate complex, detailed JSON objects using more powerful models:
137
+
138
+ ```js
139
+ const object = await runtime.useModel(ModelType.OBJECT_LARGE, {
140
+ prompt: "Generate a detailed JSON object representing a restaurant",
141
+ temperature: 0.7, // optional
142
+ });
143
+ ```
144
+
145
+ ## Troubleshooting
146
+
147
+ ### Connection Issues
148
+
149
+ - Ensure Ollama is running by testing the `OLLAMA_API_ENDPOINT`
150
+ - Verify the `OLLAMA_API_ENDPOINT` points to the correct host and port
151
+ - Check firewall settings if connecting to a remote Ollama instance
152
+
153
+ ### Model Availability
154
+
155
+ - The plugin will attempt to download models automatically if they're not found
156
+ - You can pre-download models using `ollama pull modelname`
157
+ - Check model availability with `ollama list`
158
+
159
+ ## License
160
+
161
+ See LICENSE file for details.
@@ -1,8 +1,8 @@
1
1
  // plugin.ts
2
- import { logger as logger5, ModelType } from "@elizaos/core";
2
+ import { logger as logger5, ModelType as ModelType2 } from "@elizaos/core";
3
3
 
4
4
  // models/embedding.ts
5
- import { logger as logger2, MAX_EMBEDDING_TOKENS } from "@elizaos/core";
5
+ import { logger as logger2 } from "@elizaos/core";
6
6
  import { embed } from "ai";
7
7
  import { createOllama } from "ollama-ai-provider";
8
8
 
@@ -39,9 +39,24 @@ function getApiBase(runtime) {
39
39
  function getSmallModel(runtime) {
40
40
  return getSetting(runtime, "OLLAMA_SMALL_MODEL") || getSetting(runtime, "SMALL_MODEL") || DEFAULT_SMALL_MODEL;
41
41
  }
42
+ function getNanoModel(runtime) {
43
+ return getSetting(runtime, "OLLAMA_NANO_MODEL") || getSetting(runtime, "NANO_MODEL") || getSmallModel(runtime);
44
+ }
45
+ function getMediumModel(runtime) {
46
+ return getSetting(runtime, "OLLAMA_MEDIUM_MODEL") || getSetting(runtime, "MEDIUM_MODEL") || getSmallModel(runtime);
47
+ }
42
48
  function getLargeModel(runtime) {
43
49
  return getSetting(runtime, "OLLAMA_LARGE_MODEL") || getSetting(runtime, "LARGE_MODEL") || DEFAULT_LARGE_MODEL;
44
50
  }
51
+ function getMegaModel(runtime) {
52
+ return getSetting(runtime, "OLLAMA_MEGA_MODEL") || getSetting(runtime, "MEGA_MODEL") || getLargeModel(runtime);
53
+ }
54
+ function getResponseHandlerModel(runtime) {
55
+ return getSetting(runtime, "OLLAMA_RESPONSE_HANDLER_MODEL") || getSetting(runtime, "OLLAMA_SHOULD_RESPOND_MODEL") || getSetting(runtime, "RESPONSE_HANDLER_MODEL") || getSetting(runtime, "SHOULD_RESPOND_MODEL") || getNanoModel(runtime);
56
+ }
57
+ function getActionPlannerModel(runtime) {
58
+ return getSetting(runtime, "OLLAMA_ACTION_PLANNER_MODEL") || getSetting(runtime, "OLLAMA_PLANNER_MODEL") || getSetting(runtime, "ACTION_PLANNER_MODEL") || getSetting(runtime, "PLANNER_MODEL") || getMediumModel(runtime);
59
+ }
45
60
  function getEmbeddingModel(runtime) {
46
61
  return getSetting(runtime, "OLLAMA_EMBEDDING_MODEL") || DEFAULT_EMBEDDING_MODEL;
47
62
  }
@@ -90,9 +105,9 @@ async function handleTextEmbedding(runtime, params) {
90
105
  logger2.log(`[Ollama] Using TEXT_EMBEDDING model: ${modelName}`);
91
106
  await ensureModelAvailable(modelName, baseURL, customFetch);
92
107
  let text = typeof params === "string" ? params : params ? params.text || "" : "";
93
- const maxChars = MAX_EMBEDDING_TOKENS * 4;
108
+ const maxChars = 8000 * 4;
94
109
  if (text.length > maxChars) {
95
- logger2.warn(`[Ollama] Embedding input too long (~${Math.ceil(text.length / 4)} tokens), truncating to ~${MAX_EMBEDDING_TOKENS} tokens`);
110
+ logger2.warn(`[Ollama] Embedding input too long (~${Math.ceil(text.length / 4)} tokens), truncating to ~8000 tokens`);
96
111
  text = text.slice(0, maxChars);
97
112
  }
98
113
  const embeddingText = text || "test";
@@ -168,9 +183,14 @@ async function handleObjectLarge(runtime, params) {
168
183
  }
169
184
 
170
185
  // models/text.ts
171
- import { logger as logger4 } from "@elizaos/core";
186
+ import { logger as logger4, ModelType } from "@elizaos/core";
172
187
  import { generateText } from "ai";
173
188
  import { createOllama as createOllama3 } from "ollama-ai-provider";
189
+ var TEXT_NANO_MODEL_TYPE = ModelType.TEXT_NANO ?? "TEXT_NANO";
190
+ var TEXT_MEDIUM_MODEL_TYPE = ModelType.TEXT_MEDIUM ?? "TEXT_MEDIUM";
191
+ var TEXT_MEGA_MODEL_TYPE = ModelType.TEXT_MEGA ?? "TEXT_MEGA";
192
+ var RESPONSE_HANDLER_MODEL_TYPE = ModelType.RESPONSE_HANDLER ?? "RESPONSE_HANDLER";
193
+ var ACTION_PLANNER_MODEL_TYPE = ModelType.ACTION_PLANNER ?? "ACTION_PLANNER";
174
194
  async function generateOllamaText(ollama, model, params) {
175
195
  try {
176
196
  const generateParams = {
@@ -190,36 +210,27 @@ async function generateOllamaText(ollama, model, params) {
190
210
  return "Error generating text. Please try again later.";
191
211
  }
192
212
  }
193
- async function handleTextSmall(runtime, { prompt, stopSequences = [] }) {
194
- try {
195
- const temperature = 0.7;
196
- const frequency_penalty = 0.7;
197
- const presence_penalty = 0.7;
198
- const max_response_length = 8000;
199
- const baseURL = getBaseURL(runtime);
200
- const customFetch = runtime.fetch ?? undefined;
201
- const ollama = createOllama3({
202
- fetch: customFetch,
203
- baseURL
204
- });
205
- const model = getSmallModel(runtime);
206
- logger4.log(`[Ollama] Using TEXT_SMALL model: ${model}`);
207
- await ensureModelAvailable(model, baseURL, customFetch);
208
- return await generateOllamaText(ollama, model, {
209
- prompt,
210
- system: runtime.character?.system ?? undefined,
211
- temperature,
212
- maxTokens: max_response_length,
213
- frequencyPenalty: frequency_penalty,
214
- presencePenalty: presence_penalty,
215
- stopSequences
216
- });
217
- } catch (error) {
218
- logger4.error({ error }, "Error in TEXT_SMALL model");
219
- return "Error generating text. Please try again later.";
213
+ function getModelNameForType(runtime, modelType) {
214
+ switch (modelType) {
215
+ case TEXT_NANO_MODEL_TYPE:
216
+ return getNanoModel(runtime);
217
+ case TEXT_MEDIUM_MODEL_TYPE:
218
+ return getMediumModel(runtime);
219
+ case ModelType.TEXT_SMALL:
220
+ return getSmallModel(runtime);
221
+ case ModelType.TEXT_LARGE:
222
+ return getLargeModel(runtime);
223
+ case TEXT_MEGA_MODEL_TYPE:
224
+ return getMegaModel(runtime);
225
+ case RESPONSE_HANDLER_MODEL_TYPE:
226
+ return getResponseHandlerModel(runtime);
227
+ case ACTION_PLANNER_MODEL_TYPE:
228
+ return getActionPlannerModel(runtime);
229
+ default:
230
+ return getLargeModel(runtime);
220
231
  }
221
232
  }
222
- async function handleTextLarge(runtime, {
233
+ async function handleTextWithModelType(runtime, modelType, {
223
234
  prompt,
224
235
  stopSequences = [],
225
236
  maxTokens = 8192,
@@ -228,14 +239,14 @@ async function handleTextLarge(runtime, {
228
239
  presencePenalty = 0.7
229
240
  }) {
230
241
  try {
231
- const model = getLargeModel(runtime);
232
242
  const baseURL = getBaseURL(runtime);
233
243
  const customFetch = runtime.fetch ?? undefined;
234
244
  const ollama = createOllama3({
235
245
  fetch: customFetch,
236
246
  baseURL
237
247
  });
238
- logger4.log(`[Ollama] Using TEXT_LARGE model: ${model}`);
248
+ const model = getModelNameForType(runtime, modelType);
249
+ logger4.log(`[Ollama] Using ${modelType} model: ${model}`);
239
250
  await ensureModelAvailable(model, baseURL, customFetch);
240
251
  return await generateOllamaText(ollama, model, {
241
252
  prompt,
@@ -247,10 +258,31 @@ async function handleTextLarge(runtime, {
247
258
  stopSequences
248
259
  });
249
260
  } catch (error) {
250
- logger4.error({ error }, "Error in TEXT_LARGE model");
261
+ logger4.error({ error }, `Error in ${modelType} model`);
251
262
  return "Error generating text. Please try again later.";
252
263
  }
253
264
  }
265
+ async function handleTextSmall(runtime, params) {
266
+ return handleTextWithModelType(runtime, ModelType.TEXT_SMALL, params);
267
+ }
268
+ async function handleTextNano(runtime, params) {
269
+ return handleTextWithModelType(runtime, TEXT_NANO_MODEL_TYPE, params);
270
+ }
271
+ async function handleTextMedium(runtime, params) {
272
+ return handleTextWithModelType(runtime, TEXT_MEDIUM_MODEL_TYPE, params);
273
+ }
274
+ async function handleTextLarge(runtime, params) {
275
+ return handleTextWithModelType(runtime, ModelType.TEXT_LARGE, params);
276
+ }
277
+ async function handleTextMega(runtime, params) {
278
+ return handleTextWithModelType(runtime, TEXT_MEGA_MODEL_TYPE, params);
279
+ }
280
+ async function handleResponseHandler(runtime, params) {
281
+ return handleTextWithModelType(runtime, RESPONSE_HANDLER_MODEL_TYPE, params);
282
+ }
283
+ async function handleActionPlanner(runtime, params) {
284
+ return handleTextWithModelType(runtime, ACTION_PLANNER_MODEL_TYPE, params);
285
+ }
254
286
 
255
287
  // plugin.ts
256
288
  var _globalThis = globalThis;
@@ -262,14 +294,34 @@ function getProcessEnv() {
262
294
  return process.env;
263
295
  }
264
296
  var env = getProcessEnv();
297
+ var TEXT_NANO_MODEL_TYPE2 = ModelType2.TEXT_NANO ?? "TEXT_NANO";
298
+ var TEXT_MEDIUM_MODEL_TYPE2 = ModelType2.TEXT_MEDIUM ?? "TEXT_MEDIUM";
299
+ var TEXT_MEGA_MODEL_TYPE2 = ModelType2.TEXT_MEGA ?? "TEXT_MEGA";
300
+ var RESPONSE_HANDLER_MODEL_TYPE2 = ModelType2.RESPONSE_HANDLER ?? "RESPONSE_HANDLER";
301
+ var ACTION_PLANNER_MODEL_TYPE2 = ModelType2.ACTION_PLANNER ?? "ACTION_PLANNER";
265
302
  var ollamaPlugin = {
266
303
  name: "ollama",
267
304
  description: "Ollama plugin for local LLM inference",
268
305
  config: {
269
306
  OLLAMA_API_ENDPOINT: env.OLLAMA_API_ENDPOINT ?? null,
307
+ OLLAMA_NANO_MODEL: env.OLLAMA_NANO_MODEL ?? null,
270
308
  OLLAMA_SMALL_MODEL: env.OLLAMA_SMALL_MODEL ?? null,
271
309
  OLLAMA_MEDIUM_MODEL: env.OLLAMA_MEDIUM_MODEL ?? null,
272
310
  OLLAMA_LARGE_MODEL: env.OLLAMA_LARGE_MODEL ?? null,
311
+ OLLAMA_MEGA_MODEL: env.OLLAMA_MEGA_MODEL ?? null,
312
+ OLLAMA_RESPONSE_HANDLER_MODEL: env.OLLAMA_RESPONSE_HANDLER_MODEL ?? null,
313
+ OLLAMA_SHOULD_RESPOND_MODEL: env.OLLAMA_SHOULD_RESPOND_MODEL ?? null,
314
+ OLLAMA_ACTION_PLANNER_MODEL: env.OLLAMA_ACTION_PLANNER_MODEL ?? null,
315
+ OLLAMA_PLANNER_MODEL: env.OLLAMA_PLANNER_MODEL ?? null,
316
+ NANO_MODEL: env.NANO_MODEL ?? null,
317
+ MEDIUM_MODEL: env.MEDIUM_MODEL ?? null,
318
+ SMALL_MODEL: env.SMALL_MODEL ?? null,
319
+ LARGE_MODEL: env.LARGE_MODEL ?? null,
320
+ MEGA_MODEL: env.MEGA_MODEL ?? null,
321
+ RESPONSE_HANDLER_MODEL: env.RESPONSE_HANDLER_MODEL ?? null,
322
+ SHOULD_RESPOND_MODEL: env.SHOULD_RESPOND_MODEL ?? null,
323
+ ACTION_PLANNER_MODEL: env.ACTION_PLANNER_MODEL ?? null,
324
+ PLANNER_MODEL: env.PLANNER_MODEL ?? null,
273
325
  OLLAMA_EMBEDDING_MODEL: env.OLLAMA_EMBEDDING_MODEL ?? null
274
326
  },
275
327
  async init(_config, runtime) {
@@ -295,19 +347,34 @@ var ollamaPlugin = {
295
347
  }
296
348
  },
297
349
  models: {
298
- [ModelType.TEXT_EMBEDDING]: async (runtime, params) => {
350
+ [ModelType2.TEXT_EMBEDDING]: async (runtime, params) => {
299
351
  return handleTextEmbedding(runtime, params);
300
352
  },
301
- [ModelType.TEXT_SMALL]: async (runtime, params) => {
353
+ [TEXT_NANO_MODEL_TYPE2]: async (runtime, params) => {
354
+ return handleTextNano(runtime, params);
355
+ },
356
+ [ModelType2.TEXT_SMALL]: async (runtime, params) => {
302
357
  return handleTextSmall(runtime, params);
303
358
  },
304
- [ModelType.TEXT_LARGE]: async (runtime, params) => {
359
+ [TEXT_MEDIUM_MODEL_TYPE2]: async (runtime, params) => {
360
+ return handleTextMedium(runtime, params);
361
+ },
362
+ [ModelType2.TEXT_LARGE]: async (runtime, params) => {
305
363
  return handleTextLarge(runtime, params);
306
364
  },
307
- [ModelType.OBJECT_SMALL]: async (runtime, params) => {
365
+ [TEXT_MEGA_MODEL_TYPE2]: async (runtime, params) => {
366
+ return handleTextMega(runtime, params);
367
+ },
368
+ [RESPONSE_HANDLER_MODEL_TYPE2]: async (runtime, params) => {
369
+ return handleResponseHandler(runtime, params);
370
+ },
371
+ [ACTION_PLANNER_MODEL_TYPE2]: async (runtime, params) => {
372
+ return handleActionPlanner(runtime, params);
373
+ },
374
+ [ModelType2.OBJECT_SMALL]: async (runtime, params) => {
308
375
  return handleObjectSmall(runtime, params);
309
376
  },
310
- [ModelType.OBJECT_LARGE]: async (runtime, params) => {
377
+ [ModelType2.OBJECT_LARGE]: async (runtime, params) => {
311
378
  return handleObjectLarge(runtime, params);
312
379
  }
313
380
  },
@@ -333,7 +400,8 @@ var ollamaPlugin = {
333
400
  name: "ollama_test_text_embedding",
334
401
  fn: async (runtime) => {
335
402
  try {
336
- const embedding = await runtime.useModel(ModelType.TEXT_EMBEDDING, {
403
+ const runModel = runtime.useModel.bind(runtime);
404
+ const embedding = await runModel(ModelType2.TEXT_EMBEDDING, {
337
405
  text: "Hello, world!"
338
406
  });
339
407
  logger5.log({ embedding }, "Generated embedding");
@@ -346,7 +414,8 @@ var ollamaPlugin = {
346
414
  name: "ollama_test_text_large",
347
415
  fn: async (runtime) => {
348
416
  try {
349
- const text = await runtime.useModel(ModelType.TEXT_LARGE, {
417
+ const runModel = runtime.useModel.bind(runtime);
418
+ const text = await runModel(ModelType2.TEXT_LARGE, {
350
419
  prompt: "What is the nature of reality in 10 words?"
351
420
  });
352
421
  if (text.length === 0) {
@@ -363,7 +432,8 @@ var ollamaPlugin = {
363
432
  name: "ollama_test_text_small",
364
433
  fn: async (runtime) => {
365
434
  try {
366
- const text = await runtime.useModel(ModelType.TEXT_SMALL, {
435
+ const runModel = runtime.useModel.bind(runtime);
436
+ const text = await runModel(ModelType2.TEXT_SMALL, {
367
437
  prompt: "What is the nature of reality in 10 words?"
368
438
  });
369
439
  if (text.length === 0) {
@@ -380,7 +450,8 @@ var ollamaPlugin = {
380
450
  name: "ollama_test_object_small",
381
451
  fn: async (runtime) => {
382
452
  try {
383
- const object = await runtime.useModel(ModelType.OBJECT_SMALL, {
453
+ const runModel = runtime.useModel.bind(runtime);
454
+ const object = await runModel(ModelType2.OBJECT_SMALL, {
384
455
  prompt: "Generate a JSON object representing a user profile with name, age, and hobbies",
385
456
  temperature: 0.7,
386
457
  schema: undefined
@@ -395,7 +466,8 @@ var ollamaPlugin = {
395
466
  name: "ollama_test_object_large",
396
467
  fn: async (runtime) => {
397
468
  try {
398
- const object = await runtime.useModel(ModelType.OBJECT_LARGE, {
469
+ const runModel = runtime.useModel.bind(runtime);
470
+ const object = await runModel(ModelType2.OBJECT_LARGE, {
399
471
  prompt: "Generate a detailed JSON object representing a restaurant with name, cuisine type, menu items with prices, and customer reviews",
400
472
  temperature: 0.7,
401
473
  schema: undefined
@@ -410,20 +482,28 @@ var ollamaPlugin = {
410
482
  }
411
483
  ]
412
484
  };
485
+ // index.browser.ts
486
+ var defaultOllamaPlugin = ollamaPlugin;
487
+ var index_browser_default = defaultOllamaPlugin;
413
488
  export {
414
489
  ollamaPlugin,
415
490
  getSmallModel,
416
491
  getSetting,
492
+ getResponseHandlerModel,
493
+ getNanoModel,
494
+ getMegaModel,
495
+ getMediumModel,
417
496
  getLargeModel,
418
497
  getEmbeddingModel,
419
498
  getBaseURL,
420
499
  getApiBase,
421
- ollamaPlugin as default,
500
+ getActionPlannerModel,
501
+ index_browser_default as default,
422
502
  DEFAULT_SMALL_MODEL,
423
503
  DEFAULT_OLLAMA_URL,
424
504
  DEFAULT_LARGE_MODEL,
425
505
  DEFAULT_EMBEDDING_MODEL
426
506
  };
427
507
 
428
- //# debugId=721B0B6B2A794CB964756E2164756E21
508
+ //# debugId=2C63C4D5DEE6210E64756E2164756E21
429
509
  //# sourceMappingURL=index.browser.js.map