feat: Gemini infographic generation service (Task 4 — Imagen 4 Fast)#626
Closed
codercatdev wants to merge 3 commits intodevfrom
Closed
feat: Gemini infographic generation service (Task 4 — Imagen 4 Fast)#626codercatdev wants to merge 3 commits intodevfrom
codercatdev wants to merge 3 commits intodevfrom
Conversation
New service at lib/services/gemini-research.ts that uses the @google/genai Interactions API for autonomous web research. Exports: - submitResearch(topic, config?) → interactionId - pollResearch(interactionId) → ResearchStatus - parseResearchReport(topic, report) → ResearchPayload - conductGeminiResearch(topic, config?) → ResearchPayload (full pipeline) All models and prompts configurable via Sanity pipelineConfig. Output matches existing ResearchPayload interface for backward compat. Co-authored-by: research <research@miriad.systems>
…nistic seeds - generateInfographicsForTopic() reads instructions from contentConfig - Deterministic seeds from topic+index for brand consistency - DEFAULT_INSTRUCTIONS with blueprint-style prompts from spec - Appends topic context to each instruction prompt
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task 4: Gemini Infographic Generation Service
New file:
lib/services/gemini-infographics.ts(~280 lines)API Surface
generateInfographic(request, model?)generateInfographicBatch(requests, options?)generateInfographicsForTopic(topic, briefing?)contentConfig.infographicInstructions, generates all infographics for a topic with deterministic seedsbuildInfographicPrompt(topic, style?)Config Integration
pipelineConfig.infographicModel(default:imagen-4-fast, $0.02/image)contentConfig.infographicInstructions(default: 5 blueprint-style prompts from spec)getConfigValue()with env var fallbacksKey Features
topic + indexhash — same topic always produces same seeds for brand consistencyerrorsarrayGoogleGenAIclient created on first use, not at import timeCost
$0.02/image × 5 instructions = **$0.10 per topic**Types Exported
InfographicResult,InfographicRequest,InfographicBatchOptions,InfographicBatchResultNot Changed
No other files modified. This is a new standalone service file. Sprint 3 (check-research route rewrite) will consume this.