Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gemini extension #17979

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add gemini extension #17979

wants to merge 1 commit into from

Conversation

viardant
Copy link

@viardant viardant commented Mar 19, 2025

Description

This pull request introduces a new fork of the existing ChatGPT extension, specifically tailored to integrate with the Gemini API. Note that a separate fork has been developed for the Claude API, and this initiative aims to provide users with a familiar interface while leveraging the Gemini API.

Key features of this extension include:

  • The ability to create “custom models” with user-defined instructions.
  • A chat interface that allows users to engage with models and save responses for easy future access.
  • Functionality to browse through chat history and previously saved responses.
  • Options to create custom AI commands utilizing various input parameters, such as selected text or clipboard content.
  • Interaction capabilities with vision-enabled models.

This implementation retains the core functionalities of the original extension while extending its use to the Gemini API, thereby enhancing the user experience for those accustomed to the previous extensions.

Screencast

Screen.Recording.2025-03-19.at.16.29.02.mp4

Checklist

- ray lint --fix
- Removes unused getConfiguration
- feat: migrate from OpenAI ChatGPT to Google Gemini
- refactor(vision): removes unsupported Temperature parameter
- refactor: remove unused imports and update token pricing
- Updates screenshot
- chore: update asset size to be compatible with raycast (512x512)
- Updates assets to match Gemini
- Fixees 400 no body on ask
- Basic reformat from GPT to Gemini (OpenAI Compatible)
- Clone ChatGPT Extension
- Raycast Extension Create
@raycastbot raycastbot added the new extension Label for PRs with new extensions label Mar 19, 2025
@raycastbot
Copy link
Collaborator

Congratulations on your new Raycast extension! 🚀

Due to our current reduced availability, the initial review may take up to 10-15 business days

Once the PR is approved and merged, the extension will be available on our Store.

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.

PR Summary

This PR adds a new Gemini extension that forks and migrates functionality from OpenAI's ChatGPT to Google's Gemini API, providing AI chat, vision analysis, and command automation capabilities through Raycast.

  • The CHANGELOG.md entry title for "Fork" should be updated to include {PR_MERGE_DATE} template string
  • Several OpenAI references remain in the codebase (e.g., cache.ts namespace 'abielzulio.chatgpt', OpenAI SDK usage in useGemini.tsx) that should be updated for Gemini
  • The LICENSE file has a future copyright year (2025) that should be corrected to current year
  • The metadata folder appears to be missing despite having view commands in package.json, which is required for store submission
  • The command descriptions in package.json contain template placeholders that should be replaced with actual descriptions

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

57 file(s) reviewed, 110 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -0,0 +1,194 @@
# Changelog

## [Fork] - 2025-03-13
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: The title needs to include {PR_MERGE_DATE} template string instead of a hardcoded date

Suggested change
## [Fork] - 2025-03-13
## [Fork] - {PR_MERGE_DATE}

Comment on lines +84 to +85
.cache
.parcel-cache
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Duplicate .cache entry - one already exists on line 84

- Feature: Forked and migrated from OpenAI's ChatGPT to Google's Gemini using OpenAI-compatible API.
- Chore: Updated documentation and preferences to reflect Gemini integration.

## [Feature] - 2025-02-23
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: The title needs to include {PR_MERGE_DATE} template string instead of a hardcoded date

Suggested change
## [Feature] - 2025-02-23
## [Feature] - {PR_MERGE_DATE}

.LSOverride

# Icon must end with two \r
Icon
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: Icon entry should be followed by empty line with two carriage returns (Icon\r\r) to properly ignore macOS icon files

Suggested change
Icon
Icon


- Fixed an authentication error when listing models which caused a crash

## [Fix & Feature] - May, 18 2023
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Inconsistent date format - should use ISO format YYYY-MM-DD like other entries

Suggested change
## [Fix & Feature] - May, 18 2023
## [Fix & Feature] - 2023-05-18

Comment on lines +63 to +68
useEffect(() => {
if (isFirstCall && enableVision) {
addFromSelected(() => {});
addFromClipboard();
}
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Missing dependency array items: addFromSelected and addFromClipboard should be included in useEffect dependencies

Suggested change
useEffect(() => {
if (isFirstCall && enableVision) {
addFromSelected(() => {});
addFromClipboard();
}
}, []);
useEffect(() => {
if (isFirstCall && enableVision) {
addFromSelected(() => {});
addFromClipboard();
}
}, [isFirstCall, enableVision, addFromSelected, addFromClipboard]);

Comment on lines +94 to +95
const imageWidth = data.type.width;
const imageHeight = data.type.height;
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: No validation of imageWidth/imageHeight before using them - could be undefined from data.type

Comment on lines +105 to +111
addFromSelected(async (error) => {
await showToast({
style: Toast.Style.Failure,
title: "Cannot copy file path",
message: String(error),
});
})
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Could be simplified using showFailureToast from @raycast/utils

Suggested change
addFromSelected(async (error) => {
await showToast({
style: Toast.Style.Failure,
title: "Cannot copy file path",
message: String(error),
});
})
addFromSelected(async (error) => {
showFailureToast("Cannot copy file path", String(error));
})

metadata={
imageMeta.size || imageMeta.width || imageMeta.height ? (
<Detail.Metadata>
{/* {(imageMeta.size || imageMeta.width || imageMeta.height) && <Detail.Metadata.Separator />} */}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Remove commented out code that adds unnecessary noise

Comment on lines +176 to +180
if (enableVision && files && files.length > 0) {
if (!validateAttachments(files)) {
setAttachmentError("Contain Invalid File");
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Validation should happen before setting files to avoid storing invalid files temporarily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new extension Label for PRs with new extensions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants