@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/dist/eval.js CHANGED
@@ -9487,12 +9487,9 @@ function buildAssistantTurn(text, toolCalls) {
9487
9487
  function buildUserContent(text, images) {
9488
9488
  const content = [{ type: "text", text }];
9489
9489
  for (const img of images ?? []) {
9490
- if ("data" in img) {
9491
- content.push({
9492
- type: "image",
9493
- source: { type: "base64", media_type: img.mimeType, data: img.data }
9494
- });
9495
- }
9490
+ content.push(
9491
+ "data" in img ? { type: "image", source: { type: "base64", media_type: img.mimeType, data: img.data } } : { type: "image", source: { type: "url", url: img.url } }
9492
+ );
9496
9493
  }
9497
9494
  return content;
9498
9495
  }
@@ -12150,6 +12147,9 @@ function readOpenAiContent(body) {
12150
12147
  return void 0;
12151
12148
  }
12152
12149
 
12150
+ // src/internal/llm/ollama-native.ts
12151
+ init_errors();
12152
+
12153
12153
  // src/internal/error-mappers/ollama.ts
12154
12154
  init_errors();
12155
12155
  function mapOllamaTransportError(args) {
@@ -12417,6 +12417,12 @@ function toOllamaMessages(message) {
12417
12417
  return [{ role: "system", content: joinTextParts(message) }];
12418
12418
  }
12419
12419
  if (message.role === "user") {
12420
+ if (message.content.some((p) => p.type === "image")) {
12421
+ throw new ConfigurationError(
12422
+ "image input is not supported on the ollama-native provider; use an OpenAI/OpenRouter model for multimodal turns",
12423
+ { code: "ollama_image_unsupported" }
12424
+ );
12425
+ }
12420
12426
  const out = [];
12421
12427
  for (const part of message.content) {
12422
12428
  if (part.type === "tool_result") {
@@ -12908,15 +12914,15 @@ function userOrToolMessages(message) {
12908
12914
  }
12909
12915
  }
12910
12916
  const userText = joinTextParts2(message);
12911
- const imageParts = message.content.filter((p) => p.type === "image");
12917
+ const imageParts = message.content.filter(
12918
+ (p) => p.type === "image"
12919
+ );
12912
12920
  if (imageParts.length > 0) {
12913
12921
  const content = [];
12914
12922
  if (userText.length > 0) content.push({ type: "text", text: userText });
12915
12923
  for (const img of imageParts) {
12916
- content.push({
12917
- type: "image_url",
12918
- image_url: { url: `data:${img.source.media_type};base64,${img.source.data}` }
12919
- });
12924
+ const url = img.source.type === "base64" ? `data:${img.source.media_type};base64,${img.source.data}` : img.source.url;
12925
+ content.push({ type: "image_url", image_url: { url } });
12920
12926
  }
12921
12927
  out.push({ role: "user", content });
12922
12928
  } else if (userText.length > 0) {