Fix menuSuggestionFlow return type and set default Gemini model in docs#227
Fix menuSuggestionFlow return type and set default Gemini model in docs#227nikhil478 wants to merge 1 commit intogenkit-ai:mainfrom
Conversation
1. Update menuSuggestionFlow to return pointer to MenuItem
2. Added genkit.WithDefaultModel("googleai/gemini-2.5-flash") in gent.Init function
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello @nikhil478, 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 refines the Highlights
Changelog
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.
Code Review
The pull request correctly updates the Go initialization example to include a default model, which is a helpful improvement for clarity. However, the change to the menuSuggestionFlow return type in the Go example (line 249) introduces a type mismatch. The author's assumption that genkit.GenerateData[MenuItem] returns a pointer is incorrect; it returns a struct value. Reverting this change fixes the compilation error and maintains consistency with other examples in the documentation.
|
Hi @nikhil478 - Can you please make that you've signed the CLA? https://github.com/genkit-ai/docsite/pull/227/checks?check_run_id=64193466970 |
|
Hi @abdallahshaban557 i haved already signed the CLA, you can check in other prs raised by me, but for this one i am not sure why its throwing error , thanks for asking :) |
perfect! I've been able to re-run the check successfully! Will get back to you on this PR! |
Summary
This PR fixes the
menuSuggestionFlowexample insrc/content/docs/docs/flows.mdxto correctly return a pointer toMenuItemand sets a default Gemini model in the initialization example.Changes
1. Set Default Model
Added:
This makes the example explicitly configure a default model, improving clarity and ensuring consistent behavior in the documentation.
2. Fix
menuSuggestionFlowReturn TypeUpdated the flow signature from:
to:
The generated
itemreturned by:is a pointer, so the flow should return
*MenuIteminstead of a struct value. This corrects the documentation to match the actual behavior and prevents confusion for developers copying the example.Why This Change?
Impact