Add FunctionGemma guide to keras#2299
Conversation
Summary of ChangesHello @laxmareddyp, 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 introduces a new guide that demonstrates how to implement native function calling with FunctionGemma within the KerasHub ecosystem. It provides a practical example of building a multi-tool AI Assistant capable of interacting with external services and system information, thereby expanding the model's utility beyond text generation. The guide covers the full lifecycle of function calling, from tool definition to execution and response formatting, offering a valuable resource for developers looking to integrate advanced tool-use features into their AI applications. 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. 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
This pull request introduces a new guide for using FunctionGemma with KerasHub for native function calling to build a multi-tool AI Assistant. While the guide is comprehensive and well-structured, it introduces a Prompt Injection vulnerability in the manual prompt construction logic, as user input is directly concatenated into the prompt without sanitizing model-specific control tokens. Additionally, there are suggestions to improve code quality, performance, and maintainability, such as correcting a date typo, enhancing exception handling, optimizing performance by avoiding object re-creation and regex re-compilation in loops, and improving code clarity by removing redundant code. A change to make the script directly runnable is also recommended for a better user experience.
hertschuh
left a comment
There was a problem hiding this comment.
Great! Can you generator the ipynb and md files?
I’ve updated Please have a look once and merge. Thanks |
| + cropped_width, | ||
| (cropped_height + margin) * i : (cropped_height + margin) * i | ||
| + cropped_height, | ||
| (cropped_width + margin) * j : (cropped_width + margin) * j + cropped_width, |
There was a problem hiding this comment.
Is this diff intentional? Might need to rebase
There was a problem hiding this comment.
Initially i rebased and try to push my code but still it is failing due to these changes are required to pass black.
This example demonstrates how to build a multi-tool AI Assistant using FunctionGemma native
function calling capabilities in KerasHub. The Assistant can execute multiple tools
including web search, stock prices, world time, and system stats.