-
Notifications
You must be signed in to change notification settings - Fork 623
feat(go): ollama plugin: add options #4028
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?
Conversation
Summary of ChangesHello @simakmak, 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 significantly upgrades the Ollama plugin by providing granular control over model generation parameters and integrating the model's internal 'thinking' process into the Genkit AI response structure. It introduces a dedicated configuration object for runtime options and ensures that the model's reasoning is captured and exposed, offering developers more flexibility and deeper insights into the AI's operation. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 support for runtime generation options and thinking modes in the Ollama integration. The changes are well-structured, adding a GenerateContentConfig to specify these options and logic to apply them to the Ollama request. The handling of 'thinking' responses from the model is also correctly implemented.
I've found one critical issue that could lead to a runtime panic and one omission where a newly added configuration option is not being used. My comments provide suggestions to address these points. Once these are fixed, the PR should be in good shape.
|
/gemini review |
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 is a great addition, introducing support for runtime generation options and thinking modes to the Ollama plugin. The implementation correctly defines new configuration structures and integrates them into the request flow. I've identified a couple of significant issues that could lead to unexpected behavior: one is an incomplete implementation for handling reasoning parts in the input, and the other is an inconsistency in how different configuration types are handled, which could confuse users. I've also included a medium-severity suggestion to enhance the type safety of the new Think configuration field.
Description
Add support for runtime generation options and thinking modes in Ollama integration.
Introduces
GenerateContentConfigwith:Think(Ollama:true/false; GPT-OSS:"low" | "medium" | "high")Temperature,TopK,TopP,MinP,Stop,NumCtx,NumPredictKeepAliveAdds
applyGenerateConfigToOllamato map config intoollamaChatRequest(Think+Options)Ensures
Thinkingcontent from model is mapped intoai.ReasoningPartExample usage:
Checklist