@warlock.js/ai-ollama 4.1.6 → 4.1.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/cjs/index.cjs +8 -8
- package/esm/config.type.d.mts +1 -1
- package/esm/embedder.mjs +1 -1
- package/esm/known-vision-models.mjs +1 -1
- package/esm/model.mjs +1 -1
- package/esm/sdk.d.mts +1 -1
- package/esm/sdk.mjs +1 -1
- package/esm/utils/map-done-reason.mjs +1 -1
- package/esm/utils/to-ollama-messages.mjs +1 -1
- package/esm/utils/to-ollama-tools.mjs +1 -1
- package/esm/utils/wrap-ollama-error.mjs +1 -1
- package/package.json +3 -3
package/cjs/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ let ollama = require("ollama");
|
|
|
3
3
|
let _warlock_js_ai = require("@warlock.js/ai");
|
|
4
4
|
let _warlock_js_logger = require("@warlock.js/logger");
|
|
5
5
|
|
|
6
|
-
//#region
|
|
6
|
+
//#region ../@warlock.js/ai-ollama/src/utils/map-done-reason.ts
|
|
7
7
|
const doneReasonMap = {
|
|
8
8
|
stop: "stop",
|
|
9
9
|
length: "length"
|
|
@@ -32,7 +32,7 @@ function mapDoneReason(raw) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
//#endregion
|
|
35
|
-
//#region
|
|
35
|
+
//#region ../@warlock.js/ai-ollama/src/utils/to-ollama-messages.ts
|
|
36
36
|
/**
|
|
37
37
|
* Convert vendor-neutral `Message[]` into the Ollama chat message
|
|
38
38
|
* shape.
|
|
@@ -115,7 +115,7 @@ function stringifyContent(content) {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
//#endregion
|
|
118
|
-
//#region
|
|
118
|
+
//#region ../@warlock.js/ai-ollama/src/utils/to-ollama-tools.ts
|
|
119
119
|
/**
|
|
120
120
|
* Convert vendor-neutral `ToolConfig[]` into Ollama's `tools` array.
|
|
121
121
|
* Each tool becomes a `{ type: "function", function: { name,
|
|
@@ -152,7 +152,7 @@ function toParameters(input) {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
//#endregion
|
|
155
|
-
//#region
|
|
155
|
+
//#region ../@warlock.js/ai-ollama/src/utils/wrap-ollama-error.ts
|
|
156
156
|
/**
|
|
157
157
|
* Wrap any thrown value caught inside the Ollama adapter into the
|
|
158
158
|
* appropriate `@warlock.js/ai` `AIError` subclass.
|
|
@@ -252,7 +252,7 @@ function buildContext(shape) {
|
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
//#endregion
|
|
255
|
-
//#region
|
|
255
|
+
//#region ../@warlock.js/ai-ollama/src/embedder.ts
|
|
256
256
|
const LOG_MODULE$1 = "ai.ollama";
|
|
257
257
|
/**
|
|
258
258
|
* Ollama-backed implementation of `EmbedderContract`
|
|
@@ -347,7 +347,7 @@ var OllamaEmbedder = class {
|
|
|
347
347
|
};
|
|
348
348
|
|
|
349
349
|
//#endregion
|
|
350
|
-
//#region
|
|
350
|
+
//#region ../@warlock.js/ai-ollama/src/known-vision-models.ts
|
|
351
351
|
/**
|
|
352
352
|
* Substrings identifying Ollama model tags whose family accepts image
|
|
353
353
|
* input (vision).
|
|
@@ -389,7 +389,7 @@ function inferVisionCapability(modelName) {
|
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
//#endregion
|
|
392
|
-
//#region
|
|
392
|
+
//#region ../@warlock.js/ai-ollama/src/model.ts
|
|
393
393
|
const LOG_MODULE = "ai.ollama";
|
|
394
394
|
/**
|
|
395
395
|
* Ollama-backed implementation of `ModelContract`.
|
|
@@ -630,7 +630,7 @@ var OllamaModel = class {
|
|
|
630
630
|
};
|
|
631
631
|
|
|
632
632
|
//#endregion
|
|
633
|
-
//#region
|
|
633
|
+
//#region ../@warlock.js/ai-ollama/src/sdk.ts
|
|
634
634
|
/**
|
|
635
635
|
* Ollama-backed implementation of `SDKAdapterContract`.
|
|
636
636
|
*
|
package/esm/config.type.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Config } from "ollama";
|
|
2
2
|
import { EmbedderConfig, ModelConfig, ModelPricing } from "@warlock.js/ai";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/ai-ollama/src/config.type.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Configuration for the Ollama SDK adapter.
|
|
7
7
|
*
|
package/esm/embedder.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { wrapOllamaError } from "./utils/wrap-ollama-error.mjs";
|
|
|
2
2
|
import "./utils/index.mjs";
|
|
3
3
|
import { log } from "@warlock.js/logger";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../@warlock.js/ai-ollama/src/embedder.ts
|
|
6
6
|
const LOG_MODULE = "ai.ollama";
|
|
7
7
|
/**
|
|
8
8
|
* Ollama-backed implementation of `EmbedderContract`
|
package/esm/model.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import "./utils/index.mjs";
|
|
|
6
6
|
import { inferVisionCapability } from "./known-vision-models.mjs";
|
|
7
7
|
import { log } from "@warlock.js/logger";
|
|
8
8
|
|
|
9
|
-
//#region
|
|
9
|
+
//#region ../@warlock.js/ai-ollama/src/model.ts
|
|
10
10
|
const LOG_MODULE = "ai.ollama";
|
|
11
11
|
/**
|
|
12
12
|
* Ollama-backed implementation of `ModelContract`.
|
package/esm/sdk.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OllamaEmbedderConfig, OllamaModelConfig, OllamaSDKConfig } from "./config.type.mjs";
|
|
2
2
|
import { EmbedderContract, ModelContract, SDKAdapterContract } from "@warlock.js/ai";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/ai-ollama/src/sdk.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Ollama-backed implementation of `SDKAdapterContract`.
|
|
7
7
|
*
|
package/esm/sdk.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { OllamaModel } from "./model.mjs";
|
|
|
3
3
|
import { Ollama } from "ollama";
|
|
4
4
|
import { approximateTokenCount } from "@warlock.js/ai";
|
|
5
5
|
|
|
6
|
-
//#region
|
|
6
|
+
//#region ../@warlock.js/ai-ollama/src/sdk.ts
|
|
7
7
|
/**
|
|
8
8
|
* Ollama-backed implementation of `SDKAdapterContract`.
|
|
9
9
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InvalidRequestError } from "@warlock.js/ai";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/ai-ollama/src/utils/to-ollama-messages.ts
|
|
4
4
|
/**
|
|
5
5
|
* Convert vendor-neutral `Message[]` into the Ollama chat message
|
|
6
6
|
* shape.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { extractJsonSchema } from "@warlock.js/ai";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/ai-ollama/src/utils/to-ollama-tools.ts
|
|
4
4
|
/**
|
|
5
5
|
* Convert vendor-neutral `ToolConfig[]` into Ollama's `tools` array.
|
|
6
6
|
* Each tool becomes a `{ type: "function", function: { name,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AIError, ContextLengthExceededError, InvalidRequestError, ProviderAuthError, ProviderError, ProviderRateLimitError, ProviderTimeoutError } from "@warlock.js/ai";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/ai-ollama/src/utils/wrap-ollama-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* Wrap any thrown value caught inside the Ollama adapter into the
|
|
6
6
|
* appropriate `@warlock.js/ai` `AIError` subclass.
|
package/package.json
CHANGED
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"ollama": "^0.6.3",
|
|
17
|
-
"@warlock.js/logger": "
|
|
17
|
+
"@warlock.js/logger": "*"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@warlock.js/ai": "
|
|
20
|
+
"@warlock.js/ai": "*"
|
|
21
21
|
},
|
|
22
|
-
"version": "4.1.
|
|
22
|
+
"version": "4.1.8",
|
|
23
23
|
"main": "./cjs/index.cjs",
|
|
24
24
|
"module": "./esm/index.mjs",
|
|
25
25
|
"types": "./esm/index.d.mts",
|