@nemesis-oss/ollama-sdk 1.18.0 → 1.19.0
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/CHANGELOG.md +25 -0
- package/README.md +1 -1
- package/dist/{anthropic-BvHOsidk.d.cts → anthropic-CAvwqIjx.d.ts} +3 -3
- package/dist/{anthropic-CvGVSoVP.d.ts → anthropic-DIPnBwlf.d.cts} +3 -3
- package/dist/{compose-CeFbHJeO.d.ts → compose-75UFDzOO.d.ts} +1 -1
- package/dist/{compose-DFkmtUOP.d.cts → compose-C4QxEZOS.d.cts} +1 -1
- package/dist/generated-api.cjs +5 -3
- package/dist/generated-api.cjs.map +1 -1
- package/dist/generated-api.d.cts +9 -9
- package/dist/generated-api.d.ts +9 -9
- package/dist/generated-api.js +5 -3
- package/dist/generated-api.js.map +1 -1
- package/dist/generated-runtime.cjs +22 -4
- package/dist/generated-runtime.cjs.map +1 -1
- package/dist/generated-runtime.d.cts +2 -2
- package/dist/generated-runtime.d.ts +2 -2
- package/dist/generated-runtime.js +22 -4
- package/dist/generated-runtime.js.map +1 -1
- package/dist/index.cjs +48 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +76 -36
- package/dist/index.d.ts +76 -36
- package/dist/index.js +48 -15
- package/dist/index.js.map +1 -1
- package/dist/mcp/tools.json +3 -3
- package/dist/mcp-generated.cjs +5 -3
- package/dist/mcp-generated.cjs.map +1 -1
- package/dist/mcp-generated.d.cts +2 -2
- package/dist/mcp-generated.d.ts +2 -2
- package/dist/mcp-generated.js +5 -3
- package/dist/mcp-generated.js.map +1 -1
- package/dist/{runtime-CdZP-N7j.d.cts → runtime-C28YEAHC.d.cts} +28 -5
- package/dist/{runtime-CFuv7Ifh.d.ts → runtime-DYCxYGG-.d.ts} +28 -5
- package/dist/skills.cjs.map +1 -1
- package/dist/skills.d.cts +3 -3
- package/dist/skills.d.ts +3 -3
- package/dist/skills.js.map +1 -1
- package/dist/{types-DbPnfVh-.d.cts → types-Y3u0FtdN.d.cts} +10 -0
- package/dist/{types-DbPnfVh-.d.ts → types-Y3u0FtdN.d.ts} +10 -0
- package/package.json +2 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { I as InvokeRequest, O as OllamaRuntime, b as OllamaRuntimeOptions, a as OperationDefinition, S as SchemaRef } from './runtime-
|
|
1
|
+
export { I as InvokeRequest, O as OllamaRuntime, b as OllamaRuntimeOptions, a as OperationDefinition, S as SchemaRef } from './runtime-C28YEAHC.cjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import './types-
|
|
3
|
+
import './types-Y3u0FtdN.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { I as InvokeRequest, O as OllamaRuntime, b as OllamaRuntimeOptions, a as OperationDefinition, S as SchemaRef } from './runtime-
|
|
1
|
+
export { I as InvokeRequest, O as OllamaRuntime, b as OllamaRuntimeOptions, a as OperationDefinition, S as SchemaRef } from './runtime-DYCxYGG-.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import './types-
|
|
3
|
+
import './types-Y3u0FtdN.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.
|
|
@@ -800,14 +800,25 @@ var OllamaRuntime = class {
|
|
|
800
800
|
const hasImages = bodyHasImages(body);
|
|
801
801
|
const maxBytesWithImages = req.operation.constraints?.maxRequestBytesWithImages;
|
|
802
802
|
const maxBytesBase = req.operation.constraints?.maxRequestBytes;
|
|
803
|
-
const
|
|
804
|
-
if (
|
|
803
|
+
const textAndSchemaBytes = hasImages ? serializeWithoutImages(body).byteLength : serialized.byteLength;
|
|
804
|
+
if (maxBytesBase !== void 0 && textAndSchemaBytes > maxBytesBase) {
|
|
805
805
|
throw new OllamaRequestTooLargeError(
|
|
806
|
-
`Operation ${req.operation.operationId} (${req.operation.method} ${req.operation.path})
|
|
806
|
+
`Operation ${req.operation.operationId} (${req.operation.method} ${req.operation.path}) text and schema (images excluded) is ${textAndSchemaBytes} bytes, exceeding the contract limit of ${maxBytesBase} bytes.`,
|
|
807
|
+
{
|
|
808
|
+
operationId: req.operation.operationId,
|
|
809
|
+
actualBytes: textAndSchemaBytes,
|
|
810
|
+
maxBytes: maxBytesBase,
|
|
811
|
+
request: { method: req.operation.method, url: req.operation.path }
|
|
812
|
+
}
|
|
813
|
+
);
|
|
814
|
+
}
|
|
815
|
+
if (maxBytesWithImages !== void 0 && serialized.byteLength > maxBytesWithImages) {
|
|
816
|
+
throw new OllamaRequestTooLargeError(
|
|
817
|
+
`Operation ${req.operation.operationId} (${req.operation.method} ${req.operation.path}) request body is ${serialized.byteLength} bytes, exceeding the contract limit of ${maxBytesWithImages} bytes (whole request, images included).`,
|
|
807
818
|
{
|
|
808
819
|
operationId: req.operation.operationId,
|
|
809
820
|
actualBytes: serialized.byteLength,
|
|
810
|
-
maxBytes:
|
|
821
|
+
maxBytes: maxBytesWithImages,
|
|
811
822
|
request: { method: req.operation.method, url: req.operation.path }
|
|
812
823
|
}
|
|
813
824
|
);
|
|
@@ -949,6 +960,13 @@ function bodyHasImages(body) {
|
|
|
949
960
|
const images = obj.images;
|
|
950
961
|
return Array.isArray(images) && images.length > 0;
|
|
951
962
|
}
|
|
963
|
+
function serializeWithoutImages(body) {
|
|
964
|
+
if (typeof body === "object" && body !== null && !Array.isArray(body)) {
|
|
965
|
+
const { images: _images, ...rest } = body;
|
|
966
|
+
return serializeForByteCount(rest);
|
|
967
|
+
}
|
|
968
|
+
return serializeForByteCount(body);
|
|
969
|
+
}
|
|
952
970
|
function resolvePathParams(pathTemplate, pathParams) {
|
|
953
971
|
if (!pathTemplate.includes("{")) return pathTemplate;
|
|
954
972
|
const params = pathParams ?? {};
|