Skip to content

feat(gamma): add gamma integration for AI-powered content generation#3358

Merged
waleedlatif1 merged 5 commits intostagingfrom
waleedlatif1/gamma-integration
Feb 27, 2026
Merged

feat(gamma): add gamma integration for AI-powered content generation#3358
waleedlatif1 merged 5 commits intostagingfrom
waleedlatif1/gamma-integration

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Add Gamma integration with 5 API operations: generate, generate from template, check status, list themes, list folders
  • Tools, block, icon, docs, and registry entries
  • All params validated against official Gamma API docs
  • Structured outputs for check_status (credits, error objects), list endpoints (pagination with hasMore/nextCursor)
  • Advanced mode for optional fields, wandConfig for complex inputs

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Feb 27, 2026 3:09am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

Added comprehensive Gamma integration with 5 API operations for AI-powered content generation. Implementation correctly uses user-only visibility for API keys per custom instructions and properly structures outputs with typed responses.

Key changes:

  • Implemented 5 tools: gamma_generate, gamma_generate_from_template, gamma_check_status, gamma_list_themes, gamma_list_folders
  • Structured outputs with conditional fields (credits/error only when present)
  • Advanced mode fields with wandConfig for complex inputs like cardDimensions and folderIds
  • Comprehensive block configuration with operation-specific conditionals
  • Complete documentation and icon integration

Issues found:

  • Documentation bug: imageSource parameter still listed for gamma_generate_from_template endpoint but was removed in commit 7dd57e9 (the template endpoint inherits image source from the template)
  • Minor: imageModel description in generate_from_template.ts references removed imageSource parameter

Note: Tests are not included (checkbox unchecked in PR description)

Confidence Score: 4/5

  • Safe to merge after fixing documentation inconsistency
  • Well-implemented integration with proper TypeScript types, structured outputs, and correct API key handling. One documentation bug where imageSource is incorrectly documented for the template endpoint needs fixing. Code quality is high with proper error handling and pagination support.
  • Pay attention to apps/docs/content/docs/en/tools/gamma.mdx - documentation must be updated to remove imageSource parameter from generate_from_template section

Important Files Changed

Filename Overview
apps/docs/content/docs/en/tools/gamma.mdx Documentation out of sync with implementation - imageSource parameter listed for generate_from_template but doesn't exist
apps/sim/tools/gamma/generate_from_template.ts Clean implementation with minor description issue referencing removed imageSource parameter
apps/sim/tools/gamma/generate.ts Well-structured tool with comprehensive parameters and proper optional field handling
apps/sim/tools/gamma/check_status.ts Properly implements typed structured outputs with conditional credits and error objects
apps/sim/blocks/blocks/gamma.ts Comprehensive block configuration with proper conditionals, advanced mode fields, and wandConfig for complex inputs

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Start[User initiates Gamma operation] --> OpSelect{Select Operation}
    
    OpSelect -->|Generate| Gen[gamma_generate]
    OpSelect -->|Generate from Template| GenTemp[gamma_generate_from_template]
    OpSelect -->|Check Status| Check[gamma_check_status]
    OpSelect -->|List Themes| Themes[gamma_list_themes]
    OpSelect -->|List Folders| Folders[gamma_list_folders]
    
    Gen -->|inputText, textMode, format, etc| GenAPI[POST /v1.0/generations]
    GenTemp -->|gammaId, prompt, themeId, etc| TempAPI[POST /v1.0/generations/from-template]
    
    GenAPI --> GenResp[Returns generationId]
    TempAPI --> TempResp[Returns generationId]
    
    GenResp --> Poll[Use generationId with Check Status]
    TempResp --> Poll
    
    Check -->|generationId| CheckAPI[GET /v1.0/generations/:id]
    CheckAPI --> Status{Status?}
    
    Status -->|pending| Wait[Wait and poll again]
    Status -->|completed| Success[Return gammaUrl + credits]
    Status -->|failed| Error[Return error details]
    
    Wait --> Poll
    
    Themes -->|query, limit, after| ThemesAPI[GET /v1.0/themes]
    Folders -->|query, limit, after| FoldersAPI[GET /v1.0/folders]
    
    ThemesAPI --> ThemeList[Return themes array + pagination]
    FoldersAPI --> FolderList[Return folders array + pagination]
Loading

Last reviewed commit: 667839e

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

15 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

- Make credits/error conditionally included in check_status response to avoid always-truthy objects
- Replace full wordmark SVG with square "G" letterform for proper rendering in icon slots
The from-template API only accepts imageOptions.model and imageOptions.style,
not imageOptions.source (image source is inherited from the template).
@waleedlatif1 waleedlatif1 force-pushed the waleedlatif1/gamma-integration branch from 667839e to eaf244f Compare February 27, 2026 03:07
@waleedlatif1 waleedlatif1 merged commit 63fa938 into staging Feb 27, 2026
5 of 6 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/gamma-integration branch February 27, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant