Skip to content

Migrate AI functionality to free Pollinations AI - #2

Merged
SayanthRock merged 1 commit into
mainfrom
jules-14140919933872527338-8fd90bdb
Aug 7, 2026
Merged

Migrate AI functionality to free Pollinations AI#2
SayanthRock merged 1 commit into
mainfrom
jules-14140919933872527338-8fd90bdb

Conversation

@SayanthRock

@SayanthRock SayanthRock commented Aug 7, 2026

Copy link
Copy Markdown
Owner

User description

  • Added PollinationsApiService to integrate text.pollinations.ai for code analysis and PR reviews.
  • Replaced the Gemini model and removed Gemini key input to make the tool completely free and accessible without providing API keys.
  • Implemented ImageStudioScreen using image.pollinations.ai to provide an on-device image studio that generates images from text prompts completely free of charge.
  • Updated UI and logic across MainActivity, AppViewModel, ReviewViewModel, and related tests.
  • Addressed lint errors for windowLightNavigationBar.

PR created automatically by Jules for task 14140919933872527338 started by @SayanthRock


CodeAnt-AI Description

Replace paid AI setup with free AI analysis and add image generation

What Changed

  • Code analysis and pull request reviews now use Pollinations AI, so users no longer need to enter or store a Gemini key
  • The settings form only asks for a GitHub token while AI features work without an AI credential
  • Image Studio now accepts a text prompt and displays a generated image instead of showing a placeholder
  • Image generation shows loading feedback and prevents duplicate requests until the image finishes loading

Impact

✅ Free code and pull request analysis
✅ Fewer setup steps
✅ Working text-to-image generation

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • New Features
    • Added an Image Studio screen for entering prompts, generating images, and viewing results.
    • AI code analysis and pull-request reviews now use the Pollinations service.
  • Changes
    • Removed the Gemini API key requirement; only the GitHub token is saved.
    • Added improved loading and error handling for image generation.
  • Tests
    • Updated ViewModel tests for the new AI service integration.

Co-authored-by: SayanthRock <202829406+SayanthRock@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI lite review requested due to automatic review settings August 7, 2026 10:52
@devloai

devloai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Unable to trigger custom agent "Code Reviewer". You have run out of credits 😔
Please upgrade your plan or buy additional credits from the subscription page.

@codeant-ai

codeant-ai Bot commented Aug 7, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR db8a624 Aug 07, 2026 · 10:52 10:54

@ai-coding-guardrails

Copy link
Copy Markdown

You've hit your review limit for the week, but don't worry you'll get some more next week!

Contact us at hello@zenable.io if you want this rate limit to go away

@codeant-ai

codeant-ai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@performance-testing-bot

Copy link
Copy Markdown

Unable to locate .performanceTestingBot config file

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The app now uses Pollinations for AI text generation, removes Gemini key storage and input, updates dependency wiring and tests, and replaces the Image Studio placeholder with a prompt-based image generation screen.

Changes

Pollinations integration and Image Studio

Layer / File(s) Summary
Pollinations text analysis contract
app/build.gradle.kts, app/src/main/java/com/sayanthrock/freeairock/data/ai/PollinationsApiService.kt, app/src/main/java/com/sayanthrock/freeairock/data/ai/AiCodeAnalyzer.kt
Adds the Retrofit scalar converter and Pollinations request models. AiCodeAnalyzer sends prompts through PollinationsApiService.
Service wiring and credential removal
app/src/main/java/com/sayanthrock/freeairock/data/storage/SecureStorageManager.kt, app/src/main/java/com/sayanthrock/freeairock/ui/{AppViewModel,ReviewViewModel,AppViewModelFactory}.kt, app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt, app/src/main/java/com/sayanthrock/freeairock/ui/ImageViewModel.kt
Passes PollinationsApiService through application and ViewModel construction. Removes Gemini key persistence, validation, and UI state.
Image Studio rendering flow
app/src/main/java/com/sayanthrock/freeairock/ui/ImageStudioScreen.kt, app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt, app/src/main/res/values/styles.xml
Adds prompt input, seeded image URL generation, loading and error states, and image preview rendering. Activates the screen in the Image Studio tab.
Updated integration tests
app/src/test/java/com/sayanthrock/freeairock/ui/{AppViewModelFactoryTest,ReviewViewModelTest}.kt
Updates test construction with Pollinations mocks and removes Gemini key setup.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MainActivity
  participant AppViewModelFactory
  participant ReviewViewModel
  participant AiCodeAnalyzer
  participant PollinationsApiService
  MainActivity->>AppViewModelFactory: provide PollinationsApiService
  AppViewModelFactory->>ReviewViewModel: create with PollinationsApiService
  ReviewViewModel->>AiCodeAnalyzer: create analyzer
  AiCodeAnalyzer->>PollinationsApiService: generateText(PollinationsRequest)
  PollinationsApiService-->>AiCodeAnalyzer: generated text
  AiCodeAnalyzer-->>ReviewViewModel: analysis result
Loading

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: migrating the application's AI functionality from Gemini to Pollinations AI.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jules-14140919933872527338-8fd90bdb

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Aug 7, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/build.gradle.kts`:
- Line 94: Update app/build.gradle.kts:94 to include the Retrofit converter
required for the Pollinations chat-completions response model. In
PollinationsApiService.kt:16-20, replace the raw-string endpoint contract with
Pollinations’ textual chat-completions request and response model. In
AiCodeAnalyzer.kt:66-71, extract and retain the generated message text for the
fallback path, while handling request failures separately instead of returning
the API response or unrelated text. In MainActivity.kt:83-90, consume the
analyzer’s generated analysis and display the distinct failure result
appropriately.

In `@app/src/main/java/com/sayanthrock/freeairock/data/ai/AiCodeAnalyzer.kt`:
- Around line 66-70: Update the request flow around AiCodeAnalyzer’s
pollinationsApiService.generateText call to show a clear Pollinations provider
disclosure and require explicit user consent before sending prompt repository
content or pull-request diffs. Only construct and send PollinationsRequest after
consent is granted; otherwise preserve the existing operation without
transmitting the content.

In `@app/src/main/java/com/sayanthrock/freeairock/ui/ImageStudioScreen.kt`:
- Around line 93-110: Update ImageStudioScreen’s image-loading state around
SubcomposeAsyncImage to track the loading error, clear that state before each
request and in onSuccess, and set it in onError. Render an error message with a
retry instruction when loading fails so the failed image surface is
distinguishable from an empty result.

In `@app/src/test/java/com/sayanthrock/freeairock/ui/ReviewViewModelTest.kt`:
- Around line 38-43: Update the ReviewViewModelTest setup/test flow around
ReviewViewModel.run() to stub githubApiService.getPullRequestDiff() and
pollinationsApiService.generateText() with successful responses. Then assert the
resulting state is CodeAnalysisState.Success and verify the PollinationsRequest
submitted to generateText() contains the expected request data.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e0377339-5f89-445b-8cf9-7479a0503319

📥 Commits

Reviewing files that changed from the base of the PR and between 0f2c280 and db8a624.

📒 Files selected for processing (13)
  • app/build.gradle.kts
  • app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt
  • app/src/main/java/com/sayanthrock/freeairock/data/ai/AiCodeAnalyzer.kt
  • app/src/main/java/com/sayanthrock/freeairock/data/ai/PollinationsApiService.kt
  • app/src/main/java/com/sayanthrock/freeairock/data/storage/SecureStorageManager.kt
  • app/src/main/java/com/sayanthrock/freeairock/ui/AppViewModel.kt
  • app/src/main/java/com/sayanthrock/freeairock/ui/AppViewModelFactory.kt
  • app/src/main/java/com/sayanthrock/freeairock/ui/ImageStudioScreen.kt
  • app/src/main/java/com/sayanthrock/freeairock/ui/ImageViewModel.kt
  • app/src/main/java/com/sayanthrock/freeairock/ui/ReviewViewModel.kt
  • app/src/main/res/values/styles.xml
  • app/src/test/java/com/sayanthrock/freeairock/ui/AppViewModelFactoryTest.kt
  • app/src/test/java/com/sayanthrock/freeairock/ui/ReviewViewModelTest.kt

Comment thread app/build.gradle.kts
@SayanthRock
SayanthRock merged commit 7ad1949 into main Aug 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants