Add Cost and Latency Optimization Patterns example notebook#1117
Add Cost and Latency Optimization Patterns example notebook#1117pankaj0695 wants to merge 1 commit intogoogle-gemini:mainfrom
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Summary of ChangesHello @pankaj0695, 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 comprehensive example notebook designed to guide users in optimizing their interactions with the Gemini API. It provides practical strategies and measurable metrics for reducing both operational costs and response latency, covering essential techniques like token management, streaming for improved user experience, intelligent prompt design, model selection based on task requirements, and efficient batch processing for large-scale operations. Highlights
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 notebook demonstrating cost and latency optimization patterns for the Gemini API, along with updates to the README.md file to include this new example. The notebook covers important topics such as token counting, streaming, prompt trimming, model comparison, and Batch API usage, providing valuable insights for optimizing Gemini API interactions. The README.md update correctly references the new notebook. However, there are several style guide violations and minor issues that need to be addressed to ensure consistency and adherence to the repository's coding standards. Specifically, the notebook's execution_count fields are not null, indicating it has been run but not formatted. There are also inconsistencies in API key naming, unhidden helper functions, incorrect indentation for long text variables, and non-imperative table headers. The README.md also contains a minor formatting inconsistency in its bullet points.
95aee9c to
7118973
Compare
|
@Giom-V can you please review this PR |
Adds a new example notebook demonstrating practical techniques to reduce cost and latency when using the Gemini API. Covers token counting, streaming, prompt trimming, summarization, model comparison (Flash vs Pro) and Batch API usage with measurable metrics.
Fixes #1105