@theokit/sdk 4.7.0 → 4.7.1
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 +6 -0
- package/dist/cron.cjs +17 -11
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.js +17 -11
- package/dist/cron.js.map +1 -1
- package/dist/eval.cjs +17 -11
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +17 -11
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +17 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -11
- package/dist/index.js.map +1 -1
- package/dist/internal/llm/types.d.ts +3 -0
- package/package.json +1 -1
package/dist/eval.cjs
CHANGED
|
@@ -9490,12 +9490,9 @@ function buildAssistantTurn(text, toolCalls) {
|
|
|
9490
9490
|
function buildUserContent(text, images) {
|
|
9491
9491
|
const content = [{ type: "text", text }];
|
|
9492
9492
|
for (const img of images ?? []) {
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
source: { type: "base64", media_type: img.mimeType, data: img.data }
|
|
9497
|
-
});
|
|
9498
|
-
}
|
|
9493
|
+
content.push(
|
|
9494
|
+
"data" in img ? { type: "image", source: { type: "base64", media_type: img.mimeType, data: img.data } } : { type: "image", source: { type: "url", url: img.url } }
|
|
9495
|
+
);
|
|
9499
9496
|
}
|
|
9500
9497
|
return content;
|
|
9501
9498
|
}
|
|
@@ -12153,6 +12150,9 @@ function readOpenAiContent(body) {
|
|
|
12153
12150
|
return void 0;
|
|
12154
12151
|
}
|
|
12155
12152
|
|
|
12153
|
+
// src/internal/llm/ollama-native.ts
|
|
12154
|
+
init_errors();
|
|
12155
|
+
|
|
12156
12156
|
// src/internal/error-mappers/ollama.ts
|
|
12157
12157
|
init_errors();
|
|
12158
12158
|
function mapOllamaTransportError(args) {
|
|
@@ -12420,6 +12420,12 @@ function toOllamaMessages(message) {
|
|
|
12420
12420
|
return [{ role: "system", content: joinTextParts(message) }];
|
|
12421
12421
|
}
|
|
12422
12422
|
if (message.role === "user") {
|
|
12423
|
+
if (message.content.some((p) => p.type === "image")) {
|
|
12424
|
+
throw new ConfigurationError(
|
|
12425
|
+
"image input is not supported on the ollama-native provider; use an OpenAI/OpenRouter model for multimodal turns",
|
|
12426
|
+
{ code: "ollama_image_unsupported" }
|
|
12427
|
+
);
|
|
12428
|
+
}
|
|
12423
12429
|
const out = [];
|
|
12424
12430
|
for (const part of message.content) {
|
|
12425
12431
|
if (part.type === "tool_result") {
|
|
@@ -12911,15 +12917,15 @@ function userOrToolMessages(message) {
|
|
|
12911
12917
|
}
|
|
12912
12918
|
}
|
|
12913
12919
|
const userText = joinTextParts2(message);
|
|
12914
|
-
const imageParts = message.content.filter(
|
|
12920
|
+
const imageParts = message.content.filter(
|
|
12921
|
+
(p) => p.type === "image"
|
|
12922
|
+
);
|
|
12915
12923
|
if (imageParts.length > 0) {
|
|
12916
12924
|
const content = [];
|
|
12917
12925
|
if (userText.length > 0) content.push({ type: "text", text: userText });
|
|
12918
12926
|
for (const img of imageParts) {
|
|
12919
|
-
|
|
12920
|
-
|
|
12921
|
-
image_url: { url: `data:${img.source.media_type};base64,${img.source.data}` }
|
|
12922
|
-
});
|
|
12927
|
+
const url = img.source.type === "base64" ? `data:${img.source.media_type};base64,${img.source.data}` : img.source.url;
|
|
12928
|
+
content.push({ type: "image_url", image_url: { url } });
|
|
12923
12929
|
}
|
|
12924
12930
|
out.push({ role: "user", content });
|
|
12925
12931
|
} else if (userText.length > 0) {
|