@elizaos/plugin-ollama 1.0.0-beta.8
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 +21 -0
- package/README.md +103 -0
- package/dist/index.js +280 -0
- package/dist/index.js.map +1 -0
- package/package.json +72 -0
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,103 @@
|
|
|
1
|
+
# Ollama Plugin
|
|
2
|
+
|
|
3
|
+
This plugin provides integration with Ollama's local models through the ElizaOS platform.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Add the plugin to your character configuration:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
"plugins": ["@elizaos/plugin-ollama"]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Configuration
|
|
14
|
+
|
|
15
|
+
The plugin requires these environment variables (can be set in .env file or character settings):
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
"settings": {
|
|
19
|
+
"OLLAMA_API_ENDPOINT": "http://localhost:11434/api",
|
|
20
|
+
"OLLAMA_SMALL_MODEL": "llama3",
|
|
21
|
+
"OLLAMA_MEDIUM_MODEL": "your_medium_model",
|
|
22
|
+
"OLLAMA_LARGE_MODEL": "gemma3:latest",
|
|
23
|
+
"OLLAMA_EMBEDDING_MODEL": "nomic-embed-text"
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or in `.env` file:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
OLLAMA_API_ENDPOINT=http://localhost:11434/api
|
|
31
|
+
OLLAMA_SMALL_MODEL=llama3
|
|
32
|
+
OLLAMA_MEDIUM_MODEL=your_medium_model
|
|
33
|
+
OLLAMA_LARGE_MODEL=gemma3:latest
|
|
34
|
+
OLLAMA_EMBEDDING_MODEL=nomic-embed-text
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Configuration Options
|
|
38
|
+
|
|
39
|
+
- `OLLAMA_API_ENDPOINT`: Ollama API endpoint (default: http://localhost:11434/api)
|
|
40
|
+
- `OLLAMA_SMALL_MODEL`: Model for simpler tasks (default: llama3)
|
|
41
|
+
- `OLLAMA_MEDIUM_MODEL`: Medium-complexity model
|
|
42
|
+
- `OLLAMA_LARGE_MODEL`: Model for complex tasks (default: gemma3:latest)
|
|
43
|
+
- `OLLAMA_EMBEDDING_MODEL`: Model for text embeddings (default: nomic-embed-text)
|
|
44
|
+
|
|
45
|
+
The plugin provides these model classes:
|
|
46
|
+
|
|
47
|
+
- `TEXT_SMALL`: Optimized for fast responses with simpler prompts
|
|
48
|
+
- `TEXT_LARGE`: For complex tasks requiring deeper reasoning
|
|
49
|
+
- `TEXT_EMBEDDING`: Text embedding model
|
|
50
|
+
- `OBJECT_SMALL`: JSON object generation with simpler models
|
|
51
|
+
- `OBJECT_LARGE`: JSON object generation with more complex models
|
|
52
|
+
|
|
53
|
+
## Additional Features
|
|
54
|
+
|
|
55
|
+
### Text Generation (Small Model)
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
const text = await runtime.useModel(ModelType.TEXT_SMALL, {
|
|
59
|
+
prompt: 'What is the nature of reality?',
|
|
60
|
+
stopSequences: [], // optional
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Text Generation (Large Model)
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
const text = await runtime.useModel(ModelType.TEXT_LARGE, {
|
|
68
|
+
prompt: 'Write a detailed explanation of quantum physics',
|
|
69
|
+
stopSequences: [], // optional
|
|
70
|
+
maxTokens: 8192, // optional (default: 8192)
|
|
71
|
+
temperature: 0.7, // optional (default: 0.7)
|
|
72
|
+
frequencyPenalty: 0.7, // optional (default: 0.7)
|
|
73
|
+
presencePenalty: 0.7, // optional (default: 0.7)
|
|
74
|
+
});
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Text Embeddings
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
const embedding = await runtime.useModel(ModelType.TEXT_EMBEDDING, {
|
|
81
|
+
text: 'Text to embed',
|
|
82
|
+
});
|
|
83
|
+
// or
|
|
84
|
+
const embedding = await runtime.useModel(ModelType.TEXT_EMBEDDING, 'Text to embed');
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Object Generation (Small Model)
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
const object = await runtime.useModel(ModelType.OBJECT_SMALL, {
|
|
91
|
+
prompt: 'Generate a JSON object representing a user profile',
|
|
92
|
+
temperature: 0.7, // optional
|
|
93
|
+
});
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Object Generation (Large Model)
|
|
97
|
+
|
|
98
|
+
```js
|
|
99
|
+
const object = await runtime.useModel(ModelType.OBJECT_LARGE, {
|
|
100
|
+
prompt: 'Generate a detailed JSON object representing a restaurant',
|
|
101
|
+
temperature: 0.7, // optional
|
|
102
|
+
});
|
|
103
|
+
```
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { ModelType, logger } from "@elizaos/core";
|
|
3
|
+
import { generateObject, generateText } from "ai";
|
|
4
|
+
import { createOllama } from "ollama-ai-provider";
|
|
5
|
+
var OLLAMA_API_URL = "http://localhost:11434/api";
|
|
6
|
+
async function generateOllamaText(ollama, model, params) {
|
|
7
|
+
try {
|
|
8
|
+
const { text: ollamaResponse } = await generateText({
|
|
9
|
+
model: ollama(model),
|
|
10
|
+
prompt: params.prompt,
|
|
11
|
+
system: params.system,
|
|
12
|
+
temperature: params.temperature,
|
|
13
|
+
maxTokens: params.maxTokens,
|
|
14
|
+
frequencyPenalty: params.frequencyPenalty,
|
|
15
|
+
presencePenalty: params.presencePenalty,
|
|
16
|
+
stopSequences: params.stopSequences
|
|
17
|
+
});
|
|
18
|
+
return ollamaResponse;
|
|
19
|
+
} catch (error) {
|
|
20
|
+
logger.error("Error in generateOllamaText:", error);
|
|
21
|
+
return "Error generating text. Please try again later.";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function generateOllamaObject(ollama, model, params) {
|
|
25
|
+
try {
|
|
26
|
+
const { object } = await generateObject({
|
|
27
|
+
model: ollama(model),
|
|
28
|
+
output: "no-schema",
|
|
29
|
+
prompt: params.prompt,
|
|
30
|
+
temperature: params.temperature
|
|
31
|
+
});
|
|
32
|
+
return object;
|
|
33
|
+
} catch (error) {
|
|
34
|
+
logger.error("Error generating object:", error);
|
|
35
|
+
return {};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
var ollamaPlugin = {
|
|
39
|
+
name: "ollama",
|
|
40
|
+
description: "Ollama plugin",
|
|
41
|
+
config: {
|
|
42
|
+
OLLAMA_API_ENDPOINT: process.env.OLLAMA_API_ENDPOINT,
|
|
43
|
+
OLLAMA_SMALL_MODEL: process.env.OLLAMA_SMALL_MODEL,
|
|
44
|
+
OLLAMA_MEDIUM_MODEL: process.env.OLLAMA_MEDIUM_MODEL,
|
|
45
|
+
OLLAMA_LARGE_MODEL: process.env.OLLAMA_LARGE_MODEL,
|
|
46
|
+
OLLAMA_EMBEDDING_MODEL: process.env.OLLAMA_EMBEDDING_MODEL
|
|
47
|
+
},
|
|
48
|
+
models: {
|
|
49
|
+
[ModelType.TEXT_EMBEDDING]: async (runtime, params) => {
|
|
50
|
+
try {
|
|
51
|
+
const ollama = createOllama({
|
|
52
|
+
fetch: runtime.fetch,
|
|
53
|
+
baseURL: runtime.getSetting("OLLAMA_API_ENDPOINT") || OLLAMA_API_URL
|
|
54
|
+
});
|
|
55
|
+
const modelName = runtime.getSetting("OLLAMA_EMBEDDING_MODEL") || "nomic-embed-text";
|
|
56
|
+
const text = typeof params === "string" ? params : params?.text || "";
|
|
57
|
+
if (!text) {
|
|
58
|
+
logger.error("No text provided for embedding");
|
|
59
|
+
return Array(1536).fill(0);
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
const response = await fetch(
|
|
63
|
+
`${runtime.getSetting("OLLAMA_API_ENDPOINT") || OLLAMA_API_URL}/embeddings`,
|
|
64
|
+
{
|
|
65
|
+
method: "POST",
|
|
66
|
+
headers: { "Content-Type": "application/json" },
|
|
67
|
+
body: JSON.stringify({
|
|
68
|
+
model: modelName,
|
|
69
|
+
prompt: text
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
if (!response.ok) {
|
|
74
|
+
throw new Error(`Embedding request failed: ${response.statusText}`);
|
|
75
|
+
}
|
|
76
|
+
const result = await response.json();
|
|
77
|
+
return result.embedding || Array(1536).fill(0);
|
|
78
|
+
} catch (embeddingError) {
|
|
79
|
+
logger.error("Error generating embedding:", embeddingError);
|
|
80
|
+
return Array(1536).fill(0);
|
|
81
|
+
}
|
|
82
|
+
} catch (error) {
|
|
83
|
+
logger.error("Error in TEXT_EMBEDDING model:", error);
|
|
84
|
+
return Array(1536).fill(0);
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
[ModelType.TEXT_SMALL]: async (runtime, { prompt, stopSequences = [] }) => {
|
|
88
|
+
try {
|
|
89
|
+
const temperature = 0.7;
|
|
90
|
+
const frequency_penalty = 0.7;
|
|
91
|
+
const presence_penalty = 0.7;
|
|
92
|
+
const max_response_length = 8e3;
|
|
93
|
+
const ollama = createOllama({
|
|
94
|
+
fetch: runtime.fetch,
|
|
95
|
+
baseURL: runtime.getSetting("OLLAMA_API_ENDPOINT") || OLLAMA_API_URL
|
|
96
|
+
});
|
|
97
|
+
const model = runtime.getSetting("OLLAMA_SMALL_MODEL") ?? runtime.getSetting("SMALL_MODEL") ?? "llama3";
|
|
98
|
+
logger.log("generating text");
|
|
99
|
+
logger.log(prompt);
|
|
100
|
+
return await generateOllamaText(ollama, model, {
|
|
101
|
+
prompt,
|
|
102
|
+
system: runtime.character.system ?? void 0,
|
|
103
|
+
temperature,
|
|
104
|
+
maxTokens: max_response_length,
|
|
105
|
+
frequencyPenalty: frequency_penalty,
|
|
106
|
+
presencePenalty: presence_penalty,
|
|
107
|
+
stopSequences
|
|
108
|
+
});
|
|
109
|
+
} catch (error) {
|
|
110
|
+
logger.error("Error in TEXT_SMALL model:", error);
|
|
111
|
+
return "Error generating text. Please try again later.";
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
[ModelType.TEXT_LARGE]: async (runtime, {
|
|
115
|
+
prompt,
|
|
116
|
+
stopSequences = [],
|
|
117
|
+
maxTokens = 8192,
|
|
118
|
+
temperature = 0.7,
|
|
119
|
+
frequencyPenalty = 0.7,
|
|
120
|
+
presencePenalty = 0.7
|
|
121
|
+
}) => {
|
|
122
|
+
try {
|
|
123
|
+
const model = runtime.getSetting("OLLAMA_LARGE_MODEL") ?? runtime.getSetting("LARGE_MODEL") ?? "gemma3:latest";
|
|
124
|
+
const ollama = createOllama({
|
|
125
|
+
fetch: runtime.fetch,
|
|
126
|
+
baseURL: runtime.getSetting("OLLAMA_API_ENDPOINT") || OLLAMA_API_URL
|
|
127
|
+
});
|
|
128
|
+
return await generateOllamaText(ollama, model, {
|
|
129
|
+
prompt,
|
|
130
|
+
system: runtime.character.system ?? void 0,
|
|
131
|
+
temperature,
|
|
132
|
+
maxTokens,
|
|
133
|
+
frequencyPenalty,
|
|
134
|
+
presencePenalty,
|
|
135
|
+
stopSequences
|
|
136
|
+
});
|
|
137
|
+
} catch (error) {
|
|
138
|
+
logger.error("Error in TEXT_LARGE model:", error);
|
|
139
|
+
return "Error generating text. Please try again later.";
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
[ModelType.OBJECT_SMALL]: async (runtime, params) => {
|
|
143
|
+
try {
|
|
144
|
+
const ollama = createOllama({
|
|
145
|
+
fetch: runtime.fetch,
|
|
146
|
+
baseURL: runtime.getSetting("OLLAMA_API_ENDPOINT") || OLLAMA_API_URL
|
|
147
|
+
});
|
|
148
|
+
const model = runtime.getSetting("OLLAMA_SMALL_MODEL") ?? runtime.getSetting("SMALL_MODEL") ?? "gemma3:latest";
|
|
149
|
+
if (params.schema) {
|
|
150
|
+
logger.info("Using OBJECT_SMALL without schema validation");
|
|
151
|
+
}
|
|
152
|
+
return await generateOllamaObject(ollama, model, params);
|
|
153
|
+
} catch (error) {
|
|
154
|
+
logger.error("Error in OBJECT_SMALL model:", error);
|
|
155
|
+
return {};
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
[ModelType.OBJECT_LARGE]: async (runtime, params) => {
|
|
159
|
+
try {
|
|
160
|
+
const ollama = createOllama({
|
|
161
|
+
fetch: runtime.fetch,
|
|
162
|
+
baseURL: runtime.getSetting("OLLAMA_API_ENDPOINT") || OLLAMA_API_URL
|
|
163
|
+
});
|
|
164
|
+
const model = runtime.getSetting("OLLAMA_LARGE_MODEL") ?? runtime.getSetting("LARGE_MODEL") ?? "gemma3:latest";
|
|
165
|
+
if (params.schema) {
|
|
166
|
+
logger.info("Using OBJECT_LARGE without schema validation");
|
|
167
|
+
}
|
|
168
|
+
return await generateOllamaObject(ollama, model, params);
|
|
169
|
+
} catch (error) {
|
|
170
|
+
logger.error("Error in OBJECT_LARGE model:", error);
|
|
171
|
+
return {};
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
tests: [
|
|
176
|
+
{
|
|
177
|
+
name: "ollama_plugin_tests",
|
|
178
|
+
tests: [
|
|
179
|
+
{
|
|
180
|
+
name: "ollama_test_url_validation",
|
|
181
|
+
fn: async (runtime) => {
|
|
182
|
+
try {
|
|
183
|
+
const baseURL = runtime.getSetting("OLLAMA_API_ENDPOINT") || OLLAMA_API_URL;
|
|
184
|
+
const response = await fetch(`${baseURL}/tags`);
|
|
185
|
+
const data = await response.json();
|
|
186
|
+
logger.log("Models Available:", data?.models?.length);
|
|
187
|
+
if (!response.ok) {
|
|
188
|
+
logger.error(`Failed to validate Ollama API: ${response.statusText}`);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
} catch (error) {
|
|
192
|
+
logger.error("Error in ollama_test_url_validation:", error);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: "ollama_test_text_embedding",
|
|
198
|
+
fn: async (runtime) => {
|
|
199
|
+
try {
|
|
200
|
+
const embedding = await runtime.useModel(ModelType.TEXT_EMBEDDING, {
|
|
201
|
+
text: "Hello, world!"
|
|
202
|
+
});
|
|
203
|
+
logger.log("embedding", embedding);
|
|
204
|
+
} catch (error) {
|
|
205
|
+
logger.error("Error in test_text_embedding:", error);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: "ollama_test_text_large",
|
|
211
|
+
fn: async (runtime) => {
|
|
212
|
+
try {
|
|
213
|
+
const text = await runtime.useModel(ModelType.TEXT_LARGE, {
|
|
214
|
+
prompt: "What is the nature of reality in 10 words?"
|
|
215
|
+
});
|
|
216
|
+
if (text.length === 0) {
|
|
217
|
+
logger.error("Failed to generate text");
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
logger.log("generated with test_text_large:", text);
|
|
221
|
+
} catch (error) {
|
|
222
|
+
logger.error("Error in test_text_large:", error);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
name: "ollama_test_text_small",
|
|
228
|
+
fn: async (runtime) => {
|
|
229
|
+
try {
|
|
230
|
+
const text = await runtime.useModel(ModelType.TEXT_SMALL, {
|
|
231
|
+
prompt: "What is the nature of reality in 10 words?"
|
|
232
|
+
});
|
|
233
|
+
if (text.length === 0) {
|
|
234
|
+
logger.error("Failed to generate text");
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
logger.log("generated with test_text_small:", text);
|
|
238
|
+
} catch (error) {
|
|
239
|
+
logger.error("Error in test_text_small:", error);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "ollama_test_object_small",
|
|
245
|
+
fn: async (runtime) => {
|
|
246
|
+
try {
|
|
247
|
+
const object = await runtime.useModel(ModelType.OBJECT_SMALL, {
|
|
248
|
+
prompt: "Generate a JSON object representing a user profile with name, age, and hobbies",
|
|
249
|
+
temperature: 0.7
|
|
250
|
+
});
|
|
251
|
+
logger.log("Generated object:", object);
|
|
252
|
+
} catch (error) {
|
|
253
|
+
logger.error("Error in test_object_small:", error);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
name: "ollama_test_object_large",
|
|
259
|
+
fn: async (runtime) => {
|
|
260
|
+
try {
|
|
261
|
+
const object = await runtime.useModel(ModelType.OBJECT_LARGE, {
|
|
262
|
+
prompt: "Generate a detailed JSON object representing a restaurant with name, cuisine type, menu items with prices, and customer reviews",
|
|
263
|
+
temperature: 0.7
|
|
264
|
+
});
|
|
265
|
+
logger.log("Generated object:", object);
|
|
266
|
+
} catch (error) {
|
|
267
|
+
logger.error("Error in test_object_large:", error);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
}
|
|
273
|
+
]
|
|
274
|
+
};
|
|
275
|
+
var index_default = ollamaPlugin;
|
|
276
|
+
export {
|
|
277
|
+
index_default as default,
|
|
278
|
+
ollamaPlugin
|
|
279
|
+
};
|
|
280
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { ObjectGenerationParams, Plugin, TextEmbeddingParams } from '@elizaos/core';\nimport { type GenerateTextParams, ModelType, logger } from '@elizaos/core';\nimport { generateObject, generateText } from 'ai';\nimport { createOllama } from 'ollama-ai-provider';\n\n// Default Ollama API URL\nconst OLLAMA_API_URL = 'http://localhost:11434/api';\n\n/**\n * Generate text using Ollama API\n */\nasync function generateOllamaText(\n ollama: ReturnType<typeof createOllama>,\n model: string,\n params: {\n prompt: string;\n system?: string;\n temperature: number;\n maxTokens: number;\n frequencyPenalty: number;\n presencePenalty: number;\n stopSequences: string[];\n }\n) {\n try {\n const { text: ollamaResponse } = await generateText({\n model: ollama(model),\n prompt: params.prompt,\n system: params.system,\n temperature: params.temperature,\n maxTokens: params.maxTokens,\n frequencyPenalty: params.frequencyPenalty,\n presencePenalty: params.presencePenalty,\n stopSequences: params.stopSequences,\n });\n return ollamaResponse;\n } catch (error: unknown) {\n logger.error('Error in generateOllamaText:', error);\n return 'Error generating text. Please try again later.';\n }\n}\n\n/**\n * Generate object using Ollama API with consistent error handling\n */\nasync function generateOllamaObject(\n ollama: ReturnType<typeof createOllama>,\n model: string,\n params: ObjectGenerationParams\n) {\n try {\n const { object } = await generateObject({\n model: ollama(model),\n output: 'no-schema',\n prompt: params.prompt,\n temperature: params.temperature,\n });\n return object;\n } catch (error: unknown) {\n logger.error('Error generating object:', error);\n return {};\n }\n}\n\nexport const ollamaPlugin: Plugin = {\n name: 'ollama',\n description: 'Ollama plugin',\n config: {\n OLLAMA_API_ENDPOINT: process.env.OLLAMA_API_ENDPOINT,\n OLLAMA_SMALL_MODEL: process.env.OLLAMA_SMALL_MODEL,\n OLLAMA_MEDIUM_MODEL: process.env.OLLAMA_MEDIUM_MODEL,\n OLLAMA_LARGE_MODEL: process.env.OLLAMA_LARGE_MODEL,\n OLLAMA_EMBEDDING_MODEL: process.env.OLLAMA_EMBEDDING_MODEL,\n },\n models: {\n [ModelType.TEXT_EMBEDDING]: async (\n runtime,\n params: TextEmbeddingParams | string | null\n ): Promise<number[]> => {\n try {\n const ollama = createOllama({\n fetch: runtime.fetch,\n baseURL: runtime.getSetting('OLLAMA_API_ENDPOINT') || OLLAMA_API_URL,\n });\n\n const modelName = runtime.getSetting('OLLAMA_EMBEDDING_MODEL') || 'nomic-embed-text';\n const text =\n typeof params === 'string' ? params : (params as TextEmbeddingParams)?.text || '';\n\n if (!text) {\n logger.error('No text provided for embedding');\n return Array(1536).fill(0);\n }\n\n // Generate embeddings - note we're using a simpler approach since generateEmbedding\n // may not be available in the current version of the AI SDK\n try {\n // This is simplified and may need to be adjusted based on the actual API\n const response = await fetch(\n `${runtime.getSetting('OLLAMA_API_ENDPOINT') || OLLAMA_API_URL}/embeddings`,\n {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n model: modelName,\n prompt: text,\n }),\n }\n );\n\n if (!response.ok) {\n throw new Error(`Embedding request failed: ${response.statusText}`);\n }\n\n const result = (await response.json()) as { embedding?: number[] };\n return result.embedding || Array(1536).fill(0);\n } catch (embeddingError) {\n logger.error('Error generating embedding:', embeddingError);\n return Array(1536).fill(0);\n }\n } catch (error) {\n logger.error('Error in TEXT_EMBEDDING model:', error);\n // Return a fallback vector rather than crashing\n return Array(1536).fill(0);\n }\n },\n [ModelType.TEXT_SMALL]: async (runtime, { prompt, stopSequences = [] }: GenerateTextParams) => {\n try {\n const temperature = 0.7;\n const frequency_penalty = 0.7;\n const presence_penalty = 0.7;\n const max_response_length = 8000;\n const ollama = createOllama({\n fetch: runtime.fetch,\n baseURL: runtime.getSetting('OLLAMA_API_ENDPOINT') || OLLAMA_API_URL,\n });\n\n const model =\n runtime.getSetting('OLLAMA_SMALL_MODEL') ?? runtime.getSetting('SMALL_MODEL') ?? 'llama3';\n\n logger.log('generating text');\n logger.log(prompt);\n\n return await generateOllamaText(ollama, model, {\n prompt,\n system: runtime.character.system ?? undefined,\n temperature,\n maxTokens: max_response_length,\n frequencyPenalty: frequency_penalty,\n presencePenalty: presence_penalty,\n stopSequences,\n });\n } catch (error) {\n logger.error('Error in TEXT_SMALL model:', error);\n return 'Error generating text. Please try again later.';\n }\n },\n [ModelType.TEXT_LARGE]: async (\n runtime,\n {\n prompt,\n stopSequences = [],\n maxTokens = 8192,\n temperature = 0.7,\n frequencyPenalty = 0.7,\n presencePenalty = 0.7,\n }: GenerateTextParams\n ) => {\n try {\n const model =\n runtime.getSetting('OLLAMA_LARGE_MODEL') ??\n runtime.getSetting('LARGE_MODEL') ??\n 'gemma3:latest';\n const ollama = createOllama({\n fetch: runtime.fetch,\n baseURL: runtime.getSetting('OLLAMA_API_ENDPOINT') || OLLAMA_API_URL,\n });\n\n return await generateOllamaText(ollama, model, {\n prompt,\n system: runtime.character.system ?? undefined,\n temperature,\n maxTokens,\n frequencyPenalty,\n presencePenalty,\n stopSequences,\n });\n } catch (error) {\n logger.error('Error in TEXT_LARGE model:', error);\n return 'Error generating text. Please try again later.';\n }\n },\n [ModelType.OBJECT_SMALL]: async (runtime, params: ObjectGenerationParams) => {\n try {\n const ollama = createOllama({\n fetch: runtime.fetch,\n baseURL: runtime.getSetting('OLLAMA_API_ENDPOINT') || OLLAMA_API_URL,\n });\n const model =\n runtime.getSetting('OLLAMA_SMALL_MODEL') ??\n runtime.getSetting('SMALL_MODEL') ??\n 'gemma3:latest';\n\n if (params.schema) {\n logger.info('Using OBJECT_SMALL without schema validation');\n }\n\n return await generateOllamaObject(ollama, model, params);\n } catch (error) {\n logger.error('Error in OBJECT_SMALL model:', error);\n // Return empty object instead of crashing\n return {};\n }\n },\n [ModelType.OBJECT_LARGE]: async (runtime, params: ObjectGenerationParams) => {\n try {\n const ollama = createOllama({\n fetch: runtime.fetch,\n baseURL: runtime.getSetting('OLLAMA_API_ENDPOINT') || OLLAMA_API_URL,\n });\n const model =\n runtime.getSetting('OLLAMA_LARGE_MODEL') ??\n runtime.getSetting('LARGE_MODEL') ??\n 'gemma3:latest';\n\n if (params.schema) {\n logger.info('Using OBJECT_LARGE without schema validation');\n }\n\n return await generateOllamaObject(ollama, model, params);\n } catch (error) {\n logger.error('Error in OBJECT_LARGE model:', error);\n // Return empty object instead of crashing\n return {};\n }\n },\n },\n tests: [\n {\n name: 'ollama_plugin_tests',\n tests: [\n {\n name: 'ollama_test_url_validation',\n fn: async (runtime) => {\n try {\n const baseURL = runtime.getSetting('OLLAMA_API_ENDPOINT') || OLLAMA_API_URL;\n const response = await fetch(`${baseURL}/tags`);\n const data = await response.json();\n logger.log('Models Available:', (data as { models: unknown[] })?.models?.length);\n if (!response.ok) {\n logger.error(`Failed to validate Ollama API: ${response.statusText}`);\n return;\n }\n } catch (error) {\n logger.error('Error in ollama_test_url_validation:', error);\n }\n },\n },\n {\n name: 'ollama_test_text_embedding',\n fn: async (runtime) => {\n try {\n const embedding = await runtime.useModel(ModelType.TEXT_EMBEDDING, {\n text: 'Hello, world!',\n });\n logger.log('embedding', embedding);\n } catch (error) {\n logger.error('Error in test_text_embedding:', error);\n }\n },\n },\n {\n name: 'ollama_test_text_large',\n fn: async (runtime) => {\n try {\n const text = await runtime.useModel(ModelType.TEXT_LARGE, {\n prompt: 'What is the nature of reality in 10 words?',\n });\n if (text.length === 0) {\n logger.error('Failed to generate text');\n return;\n }\n logger.log('generated with test_text_large:', text);\n } catch (error) {\n logger.error('Error in test_text_large:', error);\n }\n },\n },\n {\n name: 'ollama_test_text_small',\n fn: async (runtime) => {\n try {\n const text = await runtime.useModel(ModelType.TEXT_SMALL, {\n prompt: 'What is the nature of reality in 10 words?',\n });\n if (text.length === 0) {\n logger.error('Failed to generate text');\n return;\n }\n logger.log('generated with test_text_small:', text);\n } catch (error) {\n logger.error('Error in test_text_small:', error);\n }\n },\n },\n {\n name: 'ollama_test_object_small',\n fn: async (runtime) => {\n try {\n const object = await runtime.useModel(ModelType.OBJECT_SMALL, {\n prompt:\n 'Generate a JSON object representing a user profile with name, age, and hobbies',\n temperature: 0.7,\n });\n logger.log('Generated object:', object);\n } catch (error) {\n logger.error('Error in test_object_small:', error);\n }\n },\n },\n {\n name: 'ollama_test_object_large',\n fn: async (runtime) => {\n try {\n const object = await runtime.useModel(ModelType.OBJECT_LARGE, {\n prompt:\n 'Generate a detailed JSON object representing a restaurant with name, cuisine type, menu items with prices, and customer reviews',\n temperature: 0.7,\n });\n logger.log('Generated object:', object);\n } catch (error) {\n logger.error('Error in test_object_large:', error);\n }\n },\n },\n ],\n },\n ],\n};\nexport default ollamaPlugin;\n"],"mappings":";AACA,SAAkC,WAAW,cAAc;AAC3D,SAAS,gBAAgB,oBAAoB;AAC7C,SAAS,oBAAoB;AAG7B,IAAM,iBAAiB;AAKvB,eAAe,mBACb,QACA,OACA,QASA;AACA,MAAI;AACF,UAAM,EAAE,MAAM,eAAe,IAAI,MAAM,aAAa;AAAA,MAClD,OAAO,OAAO,KAAK;AAAA,MACnB,QAAQ,OAAO;AAAA,MACf,QAAQ,OAAO;AAAA,MACf,aAAa,OAAO;AAAA,MACpB,WAAW,OAAO;AAAA,MAClB,kBAAkB,OAAO;AAAA,MACzB,iBAAiB,OAAO;AAAA,MACxB,eAAe,OAAO;AAA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0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elizaos/plugin-ollama",
|
|
3
|
+
"version": "1.0.0-beta.8",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/elizaos-plugins/plugin-ollama"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
"./package.json": "./package.json",
|
|
14
|
+
".": {
|
|
15
|
+
"import": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@ai-sdk/ui-utils": "1.1.9",
|
|
26
|
+
"@elizaos/core": "1.0.0-beta.8",
|
|
27
|
+
"ai": "^4.1.25",
|
|
28
|
+
"js-tiktoken": "^1.0.18",
|
|
29
|
+
"ollama-ai-provider": "^1.2.0",
|
|
30
|
+
"tsup": "8.4.0"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsup",
|
|
34
|
+
"dev": "tsup --watch",
|
|
35
|
+
"lint": "prettier --write ./src",
|
|
36
|
+
"clean": "rm -rf dist .turbo node_modules .turbo-tsconfig.json tsconfig.tsbuildinfo",
|
|
37
|
+
"format": "prettier --write ./src",
|
|
38
|
+
"format:check": "prettier --check ./src"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"agentConfig": {
|
|
44
|
+
"pluginType": "elizaos:plugin:1.0.0",
|
|
45
|
+
"pluginParameters": {
|
|
46
|
+
"OLLAMA_SMALL_MODEL": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"description": "The name of the small Ollama model to use"
|
|
49
|
+
},
|
|
50
|
+
"OLLAMA_LARGE_MODEL": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "The name of the large Ollama model to use"
|
|
53
|
+
},
|
|
54
|
+
"OLLAMA_MEDIUM_MODEL": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "The name of the medium Ollama model to use"
|
|
57
|
+
},
|
|
58
|
+
"OLLAMA_EMBEDDING_MODEL": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"description": "The name of the embedding Ollama model to use"
|
|
61
|
+
},
|
|
62
|
+
"OLLAMA_API_ENDPOINT": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"description": "The URL of the Ollama API"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"gitHead": "a84e25ee21e33387a1303e62a2f95dc670ffddd4",
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"prettier": "3.5.3"
|
|
71
|
+
}
|
|
72
|
+
}
|