mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 10:18:00 +00:00
Check image counts against the limits vendors state
This commit is contained in:
10 files changed
+561
-283
No files matched your search
+15
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user