Check image counts against the limits vendors state

This commit is contained in:
Thorsten Sommer committed 2026-09-12 19:32:08 +02:00
1 parent 8468cdc7be
commit 4d43164577
10 files changed
+561 -283

No files matched your search

@@ -277,6 +277,21 @@ internal sealed partial class VisualBriefingBuildOrchestrator
VisualBriefingBuildStage.SOURCE_PREPARATION,
"The selected model cannot process the number of source images and visual assets.",
$"ImageCount={imageSources.Length}; SingleImage={profile.Has(Capability.SINGLE_IMAGE_INPUT)}; MultipleImages={profile.Has(Capability.MULTIPLE_IMAGE_INPUT)}.");
//
// And then the number, where a vendor has stated one. Without it, "takes several images"
// is all the check above can ask, and a briefing of two hundred pictures passes it only to
// be refused by the provider after everything has been read, uploaded and paid for.
//
// No limit is invented where none is documented. A model whose vendor says nothing keeps
// the answer it has always had, which is that several means several.
//
if (profile.Images.MaxInOneMessage is { } allowed && imageSources.Length > allowed)
throw new VisualBriefingBuildException(
VisualBriefingFailureCode.MODEL_CAPABILITY_MISSING,
VisualBriefingBuildStage.SOURCE_PREPARATION,
$"The selected model accepts at most {allowed} images at once, and this briefing uses {imageSources.Length}.",
$"ImageCount={imageSources.Length}; MaxPerMessage={profile.Images.MaxPerMessage}; MaxPerRequest={profile.Images.MaxPerRequest}.");
}
/// <summary>