kingkont 0.20.25 → 0.20.26

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.
Files changed (2) hide show
  1. package/lib/providers.js +15 -2
  2. package/package.json +1 -1
package/lib/providers.js CHANGED
@@ -529,10 +529,21 @@ async function _startGenerationViaOpenRouterVideo({ key, prompt, imageInputs, fi
529
529
  if (aspectRatio) body.aspect_ratio = aspectRatio;
530
530
  if (resolution) body.resolution = resolution;
531
531
  // image-to-video: первый кадр или первая ref-картинка.
532
+ // ВАЖНО: OpenRouter `/api/v1/videos` ждёт поле `image_url` (single),
533
+ // а не `image_input`. Раньше слали `image_input` — OpenRouter молча
534
+ // игнорировал и генерил text-to-video (юзер: «1 реф — он его не использовал»).
535
+ // Если у seedance/kling/veo через OR появятся ещё параметры для i2v
536
+ // (last_image_url для end-frame и т.д.) — добавлять по тому же принципу.
532
537
  const startImage = firstFrame || (Array.isArray(imageInputs) && imageInputs[0]) || null;
533
- if (startImage) body.image_input = startImage;
538
+ if (startImage) body.image_url = startImage;
534
539
  logCall('POST', 'OpenRouter', 'https://openrouter.ai/api/v1/videos',
535
- `model=${model} dur=${duration || '-'}s asp=${aspectRatio || '-'} res=${resolution || '-'}`);
540
+ `model=${model} dur=${duration || '-'}s asp=${aspectRatio || '-'} res=${resolution || '-'} i2v=${startImage ? 'yes' : 'no'}`);
541
+ // Полный body-dump в лог — для верификации какие поля принял OpenRouter
542
+ // (особенно `image_url` для i2v — без этого было непонятно почему ref
543
+ // не используется).
544
+ const bodyForLog = { ...body };
545
+ if (bodyForLog.image_url) bodyForLog.image_url = String(bodyForLog.image_url).slice(0, 120) + '…';
546
+ console.log(`[providers] OpenRouter video body: ${JSON.stringify(bodyForLog)}`);
536
547
  const r = await fetch('https://openrouter.ai/api/v1/videos', {
537
548
  method: 'POST',
538
549
  headers: {
@@ -550,6 +561,8 @@ async function _startGenerationViaOpenRouterVideo({ key, prompt, imageInputs, fi
550
561
  throw new Error(`OpenRouter /videos: ${baseMsg}`);
551
562
  }
552
563
  if (!data.id) throw new Error(`OpenRouter не вернул id: ${text.slice(0, 200)}`);
564
+ // Дамп ответа (особенно если OR ругнётся в `metadata` на неизвестные поля).
565
+ console.log(`[providers] OpenRouter video response: id=${data.id} status=${data.status || '?'} ${data.metadata ? 'meta=' + JSON.stringify(data.metadata).slice(0, 200) : ''}`);
553
566
  return { taskId: 'openrouter-vid:' + data.id, provider: 'openrouter' };
554
567
  }
555
568
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kingkont",
3
- "version": "0.20.25",
3
+ "version": "0.20.26",
4
4
  "description": "KingKont \u00b7 Chatium \u2014 \u043d\u043e\u0434-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441\u0446\u0435\u043d \u0441 AI-\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 (\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438/\u0432\u0438\u0434\u0435\u043e/\u0433\u043e\u043b\u043e\u0441/SFX/\u043c\u0443\u0437\u044b\u043a\u0430/\u0442\u0435\u043a\u0441\u0442)",
5
5
  "main": "main.js",
6
6
  "bin": {