Skip to content
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

Update text_generation.py #557

Closed
wants to merge 2 commits into from
Closed

Conversation

logankilpatrick
Copy link
Member

Update the quickstart and text generation snippets

@github-actions github-actions bot added status:awaiting review PR awaiting review from a maintainer component:python sdk Issue/PR related to Python SDK labels Sep 15, 2024
import google.generativeai as genai
import os

genai.configure(api_key=os.environ["GOOGLE_API_KEY"])
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the API key is set as an environment variable the SDK will automatically pick it up. Do we still want this?

@@ -23,15 +23,19 @@
class UnitTests(absltest.TestCase):
def test_text_gen_text_only_prompt(self):
# [START text_gen_text_only_prompt]
import google.generativeai as genai
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could require the import in each sample.

The trade-off is just signal-to-noise ratio.

If we expect each sample to be runnable with just a copy-paste from the site.. some things become difficult: A sample for tunedModel.delete requires that you train a tuned model first, that's a case where the signal to noise ratio is really bad.

@markmcd
Copy link
Member

markmcd commented Oct 9, 2024

Caught up with @logankilpatrick async, we'll close this and do something different instead.

@markmcd markmcd closed this Oct 9, 2024
@github-actions github-actions bot removed the status:awaiting review PR awaiting review from a maintainer label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:python sdk Issue/PR related to Python SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants