-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat: Update Search_Wikipedia_using_ReAct.ipynb notebook to use google-genai SDK #604
base: main
Are you sure you want to change the base?
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Hi @markmcd @andycandy, I have done the necessary changes to the notebook as suggested. Please review the updates and do let me know. Thanks! |
@@ -124,7 +124,7 @@ | |||
}, |
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 think it should be fixed by merging with the main branch, but can you make sure update the button to use an image instead as introduced in #512?
<a target=\"_blank\" href=\"URL\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" height=30/></a>
Reply via ReviewNB
@@ -124,7 +124,7 @@ | |||
}, |
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.
@@ -124,7 +124,7 @@ | |||
}, |
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.
Line #5. """Prepares Gemini to follow a Few-shot ReAct prompt by imitating
Can you add a line break (and indentation) after """
for readability?
Reply via ReviewNB
@@ -124,7 +124,7 @@ | |||
}, |
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.
Line #6. """Perfoms search on query
via Wikipedia api and returns its summary.
Same as before, can you add a line break (and indentation) after """
for readability?
Reply via ReviewNB
@@ -124,7 +124,7 @@ | |||
}, |
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.
Line #6. """Starts multi-turn conversation with the chat models with function calling
Same as before, can you add a line break (and indentation) after """
for readability?
Reply via ReviewNB
@@ -124,7 +124,7 @@ | |||
}, |
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.
Line #1. model_name = 'gemini-2.0-flash' # This can be any valid model name
Can you add a "MODEL_ID" variable like this?
MODEL_ID="gemini-2.0-flash" # @param ["gemini-2.0-flash-lite","gemini-2.0-flash","gemini-2.0-pro-exp-02-05"] {"allow-input":true, isTemplate: true}
As it would make the notebook easier to maintain in the future.
Reply via ReviewNB
@@ -124,7 +124,7 @@ | |||
}, |
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.
Line #2. gemini_ReAct_chat = ReAct(client=client, model=model_name, ReAct_prompt='model_instructions.txt')
Can you expend the function call on multiple lines for readability? Like:
gemini_ReAct_chat = ReAct( client=client, model=model_name, ReAct_prompt='model_instructions.txt' )
Reply via ReviewNB
@@ -124,7 +124,7 @@ | |||
}, |
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.
Line #4. response = gemini_ReAct_chat("What are the total of ages of the main trio from the new Percy Jackson and the Olympians TV series in real life?", temperature=0.2)
As before, can you expend on multiple lines to improve readability?
Reply via ReviewNB
@@ -124,7 +124,7 @@ | |||
}, |
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.
Line #1. gemini_ReAct_chat.client.models.generate_content(model=gemini_ReAct_chat.model_name, contents="What is the total of ages of the main trio from the new Percy Jackson and the Olympians TV series in real life?").text
Same as before, multiple lines would make it easier to read.
Reply via ReviewNB
Thanks for the submission @Raunak2024. I just added a couple of minor comments to make the notebook easier to understand and to maintain. Can you also check the lint and format failures and fix them (format is likely because you haven't run the formatting script, lint because a "we" needs to be changed into a "you"). If you see a lint error reported in the template notebook, just ignore it, it's because of a CL you merged with. And last thing, before you run the formatting script, can you also run all the cells to make sure everything works as expected? Thanks again! |
And thanks @andycandy for helping with the review!! |
Hi @Raunak2024 , just following up to see if you are still working on this. If not, I am happy to take it over and continue from where you left off! |
Let's give @Raunak2024 24 hours and without an update you'll be free to work on this notebook. |
Greetings @KSruthiVel @Giom-V |
This Pull Request addresses Search_Wikipedia_using_ReAct.ipynb notebook mentioned in the issue #446 and migrates it from the old google-generativeai SDK to the new google-genai SDK.