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