@nemesis-oss/ollama-sdk 1.25.0 → 1.25.2
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/dist/{anthropic-DTQ01pAS.d.cts → anthropic-DA9flTv_.d.ts} +4 -1
- package/dist/{anthropic-DdaNgdG_.d.ts → anthropic-DnsaK9Ui.d.cts} +4 -1
- package/dist/generated-api.d.cts +4 -4
- package/dist/generated-api.d.ts +4 -4
- package/dist/generated-runtime.cjs +14 -16
- package/dist/generated-runtime.cjs.map +1 -1
- package/dist/generated-runtime.d.cts +1 -1
- package/dist/generated-runtime.d.ts +1 -1
- package/dist/generated-runtime.js +14 -16
- package/dist/generated-runtime.js.map +1 -1
- package/dist/index.cjs +106 -61
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +106 -61
- package/dist/index.js.map +1 -1
- package/dist/mcp-generated.d.cts +1 -1
- package/dist/mcp-generated.d.ts +1 -1
- package/dist/{runtime-CUzw4GAE.d.cts → runtime-BoTPAvJH.d.cts} +9 -3
- package/dist/{runtime-D_rMXIVT.d.ts → runtime-DQRudJFP.d.ts} +9 -3
- package/package.json +10 -10
|
@@ -1,4 +1,4 @@
|
|
|
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-BoTPAvJH.cjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import './types-CH3pdrak.cjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
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-DQRudJFP.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import './types-CH3pdrak.js';
|
|
4
4
|
|
|
@@ -245,34 +245,32 @@ async function* parseSseStream(stream) {
|
|
|
245
245
|
}
|
|
246
246
|
return void 0;
|
|
247
247
|
};
|
|
248
|
-
|
|
249
|
-
while (true) {
|
|
250
|
-
const { done, value } = await reader.read();
|
|
251
|
-
if (done) break;
|
|
252
|
-
buffer += decoder.decode(value, { stream: true });
|
|
248
|
+
function* drainLines(endOfStream) {
|
|
253
249
|
while (true) {
|
|
254
250
|
const lf = buffer.indexOf("\n");
|
|
255
251
|
const cr = buffer.indexOf("\r");
|
|
256
|
-
if (lf === -1 && cr === -1)
|
|
257
|
-
if (
|
|
252
|
+
if (lf === -1 && cr === -1) return;
|
|
253
|
+
if (!endOfStream && lf === -1 && cr === buffer.length - 1) return;
|
|
258
254
|
const lineEnd = lf === -1 ? cr : cr === -1 ? lf : Math.min(lf, cr);
|
|
259
|
-
|
|
260
|
-
if (buffer[lineEnd] === "\r" && buffer[lineEnd + 1] === "\n") {
|
|
261
|
-
separatorLength = 2;
|
|
262
|
-
}
|
|
255
|
+
const separatorLength = buffer[lineEnd] === "\r" && buffer[lineEnd + 1] === "\n" ? 2 : 1;
|
|
263
256
|
const line = buffer.slice(0, lineEnd);
|
|
264
257
|
buffer = buffer.slice(lineEnd + separatorLength);
|
|
265
258
|
const event = processLine(line);
|
|
266
259
|
if (event) yield event;
|
|
267
260
|
}
|
|
268
261
|
}
|
|
262
|
+
const _reader = __using(_stack, disposableReader(reader), true);
|
|
263
|
+
while (true) {
|
|
264
|
+
const { done, value } = await reader.read();
|
|
265
|
+
if (done) break;
|
|
266
|
+
buffer += decoder.decode(value, { stream: true });
|
|
267
|
+
yield* drainLines(false);
|
|
268
|
+
}
|
|
269
269
|
buffer += decoder.decode();
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
270
|
+
yield* drainLines(true);
|
|
271
|
+
if (data.length > 0 || buffer.length > 0) {
|
|
272
|
+
throw new OllamaStreamError("SSE stream ended mid-event; the incomplete event was discarded");
|
|
273
273
|
}
|
|
274
|
-
const terminal = dispatch(eventType, data, lastEventId, retry);
|
|
275
|
-
if (terminal) yield terminal;
|
|
276
274
|
} catch (_) {
|
|
277
275
|
var _error = _, _hasError = true;
|
|
278
276
|
} finally {
|