mirror of
https://github.com/HeyPuter/puter.git
synced 2026-10-23 12:01:22 +00:00
Keep explicit Gemini video model selection within provider
This commit is contained in:
1 parent
aa4b98043a
commit
ee8778f8df
2 files changed
+33
-1
No files matched your search
@@ -477,6 +477,7 @@ export class VideoGenerationDriver extends PuterDriver {
|
||||
);
|
||||
if (exactPuterIdMatch) return exactPuterIdMatch;
|
||||
|
||||
return models.find((m) => m.provider === provider) ?? models[0];
|
||||
return models.find((m) => m.provider === provider) ??
|
||||
(provider === 'gemini-video-generation' ? null : models[0]);
|
||||
}
|
||||
}
|
||||
@@ -368,6 +368,37 @@ describe('GeminiVideoProvider routing', () => {
|
||||
await reachesGemini(testMode({ model, seconds: 5 }));
|
||||
});
|
||||
|
||||
it.each(['provider', 'driver'] as const)(
|
||||
'rejects a Together model when Gemini is pinned by %s',
|
||||
async (selection) => {
|
||||
const model = (await videoDriver.models()).find(
|
||||
(entry) => entry.provider === 'together-video-generation',
|
||||
)!.id;
|
||||
await expect(Promise.resolve(runWithContext({
|
||||
actor: TEST_MODE_ACTOR,
|
||||
...(selection === 'driver' ? { driverName: PROVIDER } : {}),
|
||||
}, () => videoDriver.generate({
|
||||
prompt: PROMPT,
|
||||
model,
|
||||
test_mode: true,
|
||||
...(selection === 'provider' ? { provider: PROVIDER } : {}),
|
||||
})))).rejects.toMatchObject({
|
||||
statusCode: 400,
|
||||
message: `Model not found: ${model}`,
|
||||
});
|
||||
expect(fetchSpy).not.toHaveBeenCalled();
|
||||
},
|
||||
);
|
||||
|
||||
it('allows an unpinned Together model when Gemini is configured', async () => {
|
||||
const model = (await videoDriver.models()).find(
|
||||
(entry) => entry.provider === 'together-video-generation',
|
||||
)!.id;
|
||||
await expect(withActor(TEST_MODE_ACTOR, () => videoDriver.generate({
|
||||
prompt: PROMPT, model, test_mode: true,
|
||||
}))).resolves.toBe(SAMPLE_URL);
|
||||
});
|
||||
|
||||
it('keeps Together as the default when both are configured', async () => {
|
||||
await expect(
|
||||
Promise.resolve(
|
||||
|
||||
Reference in new issue
Block a user