-
Notifications
You must be signed in to change notification settings - Fork 169
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
Add canonical samples for chat, caching, embeds, and code execution #205
Conversation
await cacheManager.delete(cacheResult.name); | ||
// [END cache_delete] |
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.
The other samples in this file END
the sample before deleting the cached content. Do we want to do this here, too?
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.
No, because this is the delete sample, so we want to show it in the sample.
Finish required samples (internal link: https://docs.google.com/spreadsheets/d/10X--DI0YPL3QfEMObe387rYg0t4-kuv33yKn2TIal7E/edit?resourcekey=0-kfy1Ry4YAZh6O4DltLjV9w&gid=0#gid=0)
Mostly trying to conform to Python: https://github.com/google-gemini/generative-ai-python/tree/main/samples
Also updated text_generation.js to use more convenient ways to display streaming and non streaming responses (reduce lines, write streaming to process.stdout to prevent line breaks).
Next PR is to add a script to add comments to each sample explaining what import lines (e.g.,
import { GoogleGenerativeAI } from '@google/generative-ai'
) will need to be added, since we cannot otherwise include import lines in the samples.