Skip to content

Conversation

@laxmareddyp
Copy link
Contributor

I’ve been working on a guide for function calling with KerasHub models. This final version uses the Gemma and Mistral models from KerasHub as demonstration examples.
In this guide, we’ll walk through a basic example of function calling with Gemma 3 and Mistral models on KerasHub. The steps include:

  • Defining a tool (a Python function)
  • Informing the models about the function(tool)
  • Using the model to generate code that calls the function(tool)
  • Executing the generated code and feeding the result back to the model
  • Receiving a final, natural-language response from the model

This approach showcases how to integrate external tools with KerasHub models for enhanced, interactive workflows

Refer working colab gist

@laxmareddyp laxmareddyp changed the title Function Calling with Keras Hub models A guide to using the Function Calling feature with Keras Hub models Jul 9, 2025
Copy link
Collaborator

@divyashreepathihalli divyashreepathihalli left a comment

Choose a reason for hiding this comment

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

a few nits

@divyashreepathihalli
Copy link
Collaborator

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 guide on using function calling with Keras Hub models, including examples for both Gemma and Mistral. The guide is provided as a Jupyter notebook, a Python script, and a Markdown file.

Overall, the guide is well-structured and provides a good walkthrough of the function calling feature. However, I've identified a few issues, including a critical bug in the agent loop logic that could cause a crash, some code quality concerns that could set a bad example for users, and some rendering issues in the Markdown version of the guide that make it difficult to follow.

Addressing these points will significantly improve the quality and reliability of this new guide.

@laxmareddyp
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 guide on using the function calling feature with KerasHub models, specifically Gemma and Mistral. The review focuses on improving the guide's correctness, security, and maintainability, and has identified a critical security issue, a high-severity bug, and several medium-severity issues related to code efficiency and formatting.

@laxmareddyp
Copy link
Contributor Author

/gemini review

@gemini-code-assist
Copy link
Contributor

Warning

Gemini is unable to generate a review due to a potential policy violation.

1 similar comment
@gemini-code-assist
Copy link
Contributor

Warning

Gemini is unable to generate a review due to a potential policy violation.

@laxmareddyp
Copy link
Contributor Author

/gemini review

@gemini-code-assist
Copy link
Contributor

Warning

Gemini is unable to generate a review due to a potential policy violation.

@divyashreepathihalli divyashreepathihalli merged commit 379746b into keras-team:master Jul 13, 2025
3 checks passed
@laxmareddyp laxmareddyp mentioned this pull request Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants