feat(canvas): support multimodal video storyboard tables
This commit is contained in:
1 parent
7985dbec48
commit
6d355380cb
10 files changed
+425
-45
No files matched your search
@@ -112,6 +112,14 @@ func TestMatchCapabilityRoutesTextImagesOnlyToDeclaredProfiles(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestMatchCapabilityRoutesUndeclaredVideoToTextMultimodalProfile(t *testing.T) {
|
||||
profile := CapabilitySpec{Version: 1, Capability: "text"}
|
||||
intent := ModelRequestIntent{Capability: "text", Inputs: map[string]int{"video": 1}}
|
||||
if match := MatchCapability(profile, intent); !match.Matched {
|
||||
t.Fatalf("multimodal text profile should accept legacy undeclared video input: %#v", match)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMatchCapabilityAcceptsWildcardOptionValues(t *testing.T) {
|
||||
spec := CapabilitySpec{
|
||||
Version: 1,
|
||||
|
||||
@@ -274,9 +274,12 @@ func MatchCapability(spec CapabilitySpec, intent ModelRequestIntent) CapabilityM
|
||||
}
|
||||
constraint, declared := spec.Inputs[inputType]
|
||||
if !declared {
|
||||
// Multimodal text models may accept reference images even when the
|
||||
// provider catalog does not explicitly declare the image input.
|
||||
if count > 0 && !(normalizeCapability(spec.Capability) == "text" && inputType == "image") {
|
||||
// Multimodal text models may accept reference images or videos even
|
||||
// when the provider catalog does not explicitly declare the input.
|
||||
// The concrete model capability still controls the frontend limits;
|
||||
// this fallback keeps older catalog entries routable for known
|
||||
// multimodal text endpoints.
|
||||
if count > 0 && !(normalizeCapability(spec.Capability) == "text" && (inputType == "image" || inputType == "video")) {
|
||||
reasons = append(reasons, "不支持 "+capabilityInputLabel(inputType)+"输入")
|
||||
}
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user