Read Gemini stream video limits without failing spec sync #698
Mergedtombeckenhammerged 2 commits into
main from697-gemini-genie-4-page-states-output-video-as-resolution-fps-nomerged by tombeckenham View on GitHubtombeckenham linked this to fix #697
- @@ -215,0 +250,21 @@250+ {251+ name: 'models/genie-4',252+ displayName: 'Genie 4',253+ supportedGenerationMethods: ['generateContent'],254+ },255+ {256+ name: 'models/gemini-2.5-flash',257+ displayName: 'Gemini 2.5 Flash',258+ supportedGenerationMethods: ['generateContent'],259+ },260+ ],261+ }),262+ )263+264+ const result = await geminiProvider.listModels({ GEMINI_API_KEY: KEY })265+266+ expect(result.models).toEqual([267+ expect.objectContaining({268+ rawId: 'genie-4',269+ activity: 'video',270+ schemaEndpointId: 'genie-4',@@ -190,8 +214,12 @@190214 fetchText(GEMINI_MODELS_INDEX_URL),191215 ])192216 const pages = videoModelPages(guide, index)193- const models = (194- await mapConcurrent(pages, 4, async (url) =>195- parseVideoModels(await fetchText(url), url),196- )197- ).flat()217+ const parsed = await mapConcurrent(pages, 4, async (url) => {218+ try {219+ return {220+ url,221+ models: parseVideoModels(await fetchText(url), url),222+ error: null,223+ }224+ } catch (error) {225+ return { url, models: [], error: errorMessage(error) }@@ -198,3 +229,20 @@229+ for (const page of parsed) {230+ if (!page.error) continue231+ const warning = `gemini video: ${page.url}: ${page.error}`232+ warnings.push(warning)233+ noteIngest(ingestFailedEvent('spec-sync', 'gemini', page.error, page.url))234+ console.error(warning)235+ }236+ const models = parsed.flatMap((page) => page.models)237+ const clips = models.filter(isClipModel)238+ for (const model of models) {239+ if (isClipModel(model)) continue240+ const warning = streamVideoWarning(model.rawId)241+ warnings.push(warning)242+ console.error(`gemini video: ${warning}`)243+ }198244 if (models.length === 0) {245+ const read = `(${String(pages.length)} model pages read: ${pages.join(', ') || 'none'})`246+ const base = `gemini video: ${GEMINI_VIDEO_GUIDE_URL} leads to no model with an Output video limit ${read}`199247 throw new Error(200- `gemini video: ${GEMINI_VIDEO_GUIDE_URL} leads to no model with an Output video limit (${String(pages.length)} model pages read: ${pages.join(', ') || 'none'})`,248+ warnings.length > 0 ? `${base}. ${warnings.join('; ')}` : base,
Sign in to join this conversation.
⚠️ No Changeset found#
Latest commit: 5d9b019fe9356fae075f30f188afbeb6b0fac2c4
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR