@easbot/ollama-sdk 0.3.27 → 0.3.28
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/README.en.md +9 -16
- package/README.md +9 -16
- package/package.json +3 -3
package/README.en.md
CHANGED
|
@@ -6,8 +6,7 @@ AI SDK v3 compatible Ollama Provider with automatic complete event stream genera
|
|
|
6
6
|
|
|
7
7
|
## Version
|
|
8
8
|
|
|
9
|
-
v0.3.
|
|
10
|
-
|
|
9
|
+
v0.3.28
|
|
11
10
|
## Features
|
|
12
11
|
|
|
13
12
|
- ✅ Full AI SDK v3 compatibility
|
|
@@ -316,7 +315,7 @@ All JSON Schema types are supported:
|
|
|
316
315
|
const tools = {
|
|
317
316
|
risky_operation: {
|
|
318
317
|
description: 'Operation that may fail',
|
|
319
|
-
inputSchema: {
|
|
318
|
+
inputSchema: {/* ... */},
|
|
320
319
|
execute: async (args) => {
|
|
321
320
|
try {
|
|
322
321
|
// Execute operation
|
|
@@ -382,17 +381,13 @@ const model = new NativeOllamaLanguageModel('qwen3:0.6b', {
|
|
|
382
381
|
|
|
383
382
|
// Streaming generation
|
|
384
383
|
const streamResult = await model.doStream({
|
|
385
|
-
prompt: [
|
|
386
|
-
{ role: 'user', content: [{ type: 'text', text: 'Hello' }] }
|
|
387
|
-
],
|
|
384
|
+
prompt: [{ role: 'user', content: [{ type: 'text', text: 'Hello' }] }],
|
|
388
385
|
tools: [/* ... */],
|
|
389
386
|
});
|
|
390
387
|
|
|
391
388
|
// Non-streaming generation
|
|
392
389
|
const generateResult = await model.doGenerate({
|
|
393
|
-
prompt: [
|
|
394
|
-
{ role: 'user', content: [{ type: 'text', text: 'Hello' }] }
|
|
395
|
-
],
|
|
390
|
+
prompt: [{ role: 'user', content: [{ type: 'text', text: 'Hello' }] }],
|
|
396
391
|
tools: [/* ... */],
|
|
397
392
|
});
|
|
398
393
|
```
|
|
@@ -433,22 +428,22 @@ response-metadata → text-start → text-delta (multiple) → text-end → fini
|
|
|
433
428
|
**Tool Calling:**
|
|
434
429
|
|
|
435
430
|
```
|
|
436
|
-
response-metadata → tool-input-start → tool-input-delta (multiple) →
|
|
431
|
+
response-metadata → tool-input-start → tool-input-delta (multiple) →
|
|
437
432
|
tool-input-end → tool-call → finish (finishReason: 'tool-calls')
|
|
438
433
|
```
|
|
439
434
|
|
|
440
435
|
**Reasoning + Text:**
|
|
441
436
|
|
|
442
437
|
```
|
|
443
|
-
response-metadata → reasoning-start → reasoning-delta (multiple) →
|
|
438
|
+
response-metadata → reasoning-start → reasoning-delta (multiple) →
|
|
444
439
|
reasoning-end → text-start → text-delta (multiple) → text-end → finish
|
|
445
440
|
```
|
|
446
441
|
|
|
447
442
|
**Tool Calling + Reasoning:**
|
|
448
443
|
|
|
449
444
|
```
|
|
450
|
-
response-metadata → reasoning-start → reasoning-delta (multiple) →
|
|
451
|
-
reasoning-end → tool-input-start → tool-input-delta (multiple) →
|
|
445
|
+
response-metadata → reasoning-start → reasoning-delta (multiple) →
|
|
446
|
+
reasoning-end → tool-input-start → tool-input-delta (multiple) →
|
|
452
447
|
tool-input-end → tool-call → finish
|
|
453
448
|
```
|
|
454
449
|
|
|
@@ -457,9 +452,7 @@ tool-input-end → tool-call → finish
|
|
|
457
452
|
The SDK provides complete error types:
|
|
458
453
|
|
|
459
454
|
```typescript
|
|
460
|
-
import {
|
|
461
|
-
InvalidToolDefinitionError,
|
|
462
|
-
} from '@easbot/ollama-sdk';
|
|
455
|
+
import { InvalidToolDefinitionError } from '@easbot/ollama-sdk';
|
|
463
456
|
|
|
464
457
|
try {
|
|
465
458
|
const model = new NativeOllamaLanguageModel('qwen3:0.6b');
|
package/README.md
CHANGED
|
@@ -6,8 +6,7 @@ AI SDK v3 兼容的 Ollama Provider,自动生成完整的事件流。
|
|
|
6
6
|
|
|
7
7
|
## 版本
|
|
8
8
|
|
|
9
|
-
v0.3.
|
|
10
|
-
|
|
9
|
+
v0.3.28
|
|
11
10
|
## 特性
|
|
12
11
|
|
|
13
12
|
- ✅ 完整的 AI SDK v3 兼容性
|
|
@@ -316,7 +315,7 @@ await Log.init({
|
|
|
316
315
|
const tools = {
|
|
317
316
|
risky_operation: {
|
|
318
317
|
description: '可能失败的操作',
|
|
319
|
-
inputSchema: {
|
|
318
|
+
inputSchema: {/* ... */},
|
|
320
319
|
execute: async (args) => {
|
|
321
320
|
try {
|
|
322
321
|
// 执行操作
|
|
@@ -382,17 +381,13 @@ const model = new NativeOllamaLanguageModel('qwen3:0.6b', {
|
|
|
382
381
|
|
|
383
382
|
// 流式生成
|
|
384
383
|
const streamResult = await model.doStream({
|
|
385
|
-
prompt: [
|
|
386
|
-
{ role: 'user', content: [{ type: 'text', text: 'Hello' }] }
|
|
387
|
-
],
|
|
384
|
+
prompt: [{ role: 'user', content: [{ type: 'text', text: 'Hello' }] }],
|
|
388
385
|
tools: [/* ... */],
|
|
389
386
|
});
|
|
390
387
|
|
|
391
388
|
// 非流式生成
|
|
392
389
|
const generateResult = await model.doGenerate({
|
|
393
|
-
prompt: [
|
|
394
|
-
{ role: 'user', content: [{ type: 'text', text: 'Hello' }] }
|
|
395
|
-
],
|
|
390
|
+
prompt: [{ role: 'user', content: [{ type: 'text', text: 'Hello' }] }],
|
|
396
391
|
tools: [/* ... */],
|
|
397
392
|
});
|
|
398
393
|
```
|
|
@@ -433,22 +428,22 @@ response-metadata → text-start → text-delta (多次) → text-end → finish
|
|
|
433
428
|
**工具调用:**
|
|
434
429
|
|
|
435
430
|
```
|
|
436
|
-
response-metadata → tool-input-start → tool-input-delta (多次) →
|
|
431
|
+
response-metadata → tool-input-start → tool-input-delta (多次) →
|
|
437
432
|
tool-input-end → tool-call → finish (finishReason: 'tool-calls')
|
|
438
433
|
```
|
|
439
434
|
|
|
440
435
|
**推理 + 文本:**
|
|
441
436
|
|
|
442
437
|
```
|
|
443
|
-
response-metadata → reasoning-start → reasoning-delta (多次) →
|
|
438
|
+
response-metadata → reasoning-start → reasoning-delta (多次) →
|
|
444
439
|
reasoning-end → text-start → text-delta (多次) → text-end → finish
|
|
445
440
|
```
|
|
446
441
|
|
|
447
442
|
**工具调用 + 推理:**
|
|
448
443
|
|
|
449
444
|
```
|
|
450
|
-
response-metadata → reasoning-start → reasoning-delta (多次) →
|
|
451
|
-
reasoning-end → tool-input-start → tool-input-delta (多次) →
|
|
445
|
+
response-metadata → reasoning-start → reasoning-delta (多次) →
|
|
446
|
+
reasoning-end → tool-input-start → tool-input-delta (多次) →
|
|
452
447
|
tool-input-end → tool-call → finish
|
|
453
448
|
```
|
|
454
449
|
|
|
@@ -457,9 +452,7 @@ tool-input-end → tool-call → finish
|
|
|
457
452
|
SDK 提供了完整的错误类型:
|
|
458
453
|
|
|
459
454
|
```typescript
|
|
460
|
-
import {
|
|
461
|
-
InvalidToolDefinitionError,
|
|
462
|
-
} from '@easbot/ollama-sdk';
|
|
455
|
+
import { InvalidToolDefinitionError } from '@easbot/ollama-sdk';
|
|
463
456
|
|
|
464
457
|
try {
|
|
465
458
|
const model = new NativeOllamaLanguageModel('qwen3:0.6b');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easbot/ollama-sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.28",
|
|
4
4
|
"description": "Ollama provider for Vercel AI SDK - Run local LLMs with Ollama in your AI applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@ai-sdk/provider-utils": "^4.0.45",
|
|
44
44
|
"ai": "^6.0.253",
|
|
45
45
|
"zod": "^4.4.3",
|
|
46
|
-
"@easbot/types": "0.3.
|
|
47
|
-
"@easbot/utils": "0.3.
|
|
46
|
+
"@easbot/types": "0.3.28",
|
|
47
|
+
"@easbot/utils": "0.3.28"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/node": "^25.9.5",
|