-
-
Notifications
You must be signed in to change notification settings - Fork 269
Develop #163
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
base: main
Are you sure you want to change the base?
Develop #163
Conversation
Summary of ChangesHello @Remon128, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request primarily focuses on expanding the system's AI model provider options by integrating the Groq AI service, known for its fast inference. Concurrently, it enhances user interaction by streamlining the multiline input submission process to use the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a new GroqProvider for using Groq's API and changes the multiline input submission key from Ctrl+J to Enter. The implementation of the Groq provider looks good, though I've suggested a small improvement to the error handling for better user experience.
However, the change to the key bindings has a critical side effect: it breaks the multiline input functionality entirely. I've provided a detailed comment and a code suggestion to fix this while keeping Enter as the submit key. I've also noted a couple of minor formatting issues in the changelog and one of the Python files. Please review the comments for details.
| @bindings.add("enter") | ||
| def submit(event: Any) -> None: | ||
| """Submit the current input.""" | ||
| event.app.exit(result=event.app.current_buffer.text) | ||
|
|
||
| @bindings.add("enter") | ||
| def new_line(event: Any) -> None: | ||
| """Insert a new line instead of submitting.""" | ||
| event.current_buffer.insert_text("\n") | ||
| # @bindings.add("enter") | ||
| # def new_line(event: Any) -> None: | ||
| # """Insert a new line instead of submitting.""" | ||
| # event.current_buffer.insert_text("\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By changing the submit key to Enter and commenting out the new_line function, you've disabled the ability to input multiple lines in a function named get_multiline_input. This is a significant regression in functionality.
I suggest swapping the key bindings, so that Enter submits and Ctrl+J creates a new line. This would align with the change description and preserve multiline functionality.
Additionally, the function's docstring on line 490 and the user prompt on line 514 are now outdated and should be updated to reflect these new key bindings. For example:
- Docstring:
Get multiline input from user with Enter to submit and Ctrl+J for a new line. - Prompt:
(Press Enter to submit, Ctrl+J for new line)
| @bindings.add("enter") | |
| def submit(event: Any) -> None: | |
| """Submit the current input.""" | |
| event.app.exit(result=event.app.current_buffer.text) | |
| @bindings.add("enter") | |
| def new_line(event: Any) -> None: | |
| """Insert a new line instead of submitting.""" | |
| event.current_buffer.insert_text("\n") | |
| # @bindings.add("enter") | |
| # def new_line(event: Any) -> None: | |
| # """Insert a new line instead of submitting.""" | |
| # event.current_buffer.insert_text("\n") | |
| @bindings.add("enter") | |
| def submit(event: Any) -> None: | |
| """Submit the current input.""" | |
| event.app.exit(result=event.app.current_buffer.text) | |
| @bindings.add("c-j") | |
| def new_line(event: Any) -> None: | |
| """Insert a new line instead of submitting.""" | |
| event.current_buffer.insert_text("\n") |
| - added groq provider | ||
| ## Added Files | ||
| - CHANGELOG.md | ||
| ## Fixes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| def validate_config(self) -> None: | ||
| if not self.api_key: | ||
| raise ValueError("Groq provider requires api_key.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message is a bit generic. For a better user experience, it would be helpful to guide the user on how to provide the API key, similar to how other providers in this file do (e.g., by suggesting which environment variable to set).
| raise ValueError("Groq provider requires api_key.") | |
| raise ValueError("Groq provider requires api_key. Set ORCHESTRATOR_API_KEY or CYPHER_API_KEY in .env file.") |
| return bool(response.status_code == 200) | ||
| except (httpx.RequestError, httpx.TimeoutException): | ||
| return False | ||
| return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
I would recommend using the LiteLLLM Client (not to be confused with LiteLLM Proxy), which can work with a very large list of LLM Providers. @Remon128 This is LiteLLM Proxy implementation PR (Not the client you want in this PR), but could be used to extend the functionality to be used for other providers. |
vitali87
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR has several issues:
-
Don't change the submit key. Ctrl+J is the submit key by design. Users write multiline prompts where Enter for newlines is more natural. Your change breaks multiline input entirely - you commented out the new_line function in a function called get_multiline_input.
-
Remove CHANGELOG.md. We don't maintain a changelog file - GitHub releases and commit history serve this purpose. Also the format is wrong - who is "Ali"? You're Remon Atef.
-
Don't add Groq as a separate provider. As qdrddr mentioned, PR #161 adds LiteLLM support (which will go in soon) and it already works with Groq and 100+ other providers. Adding individual providers creates unnecessary maintenance burden.
-
PR hygiene issues:
- Title "Develop" is meaningless - use a descriptive title
- No PR description
- Commented-out code instead of proper changes
- Two unrelated changes should be separate PRs
- Missing newline at EOF
|
This PR will be automatically closed in 7 days unless the author refactors it to meet our CONTRIBUTING.md standards. Please review the contribution guidelines and update this PR accordingly. |
No description provided.