Skip to content

Update text only prompts #420

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

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions samples/text_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ class UnitTests(absltest.TestCase):
def test_text_gen_text_only_prompt(self):
# [START text_gen_text_only_prompt]
model = genai.GenerativeModel("gemini-1.5-flash")
response = model.generate_content("Give me python code to sort a list")
response = model.generate_content("Write a story about a magic backpack.")
print(response.text)
# [END text_gen_text_only_prompt]

def test_text_gen_text_only_prompt_streaming(self):
# [START text_gen_text_only_prompt_streaming]
model = genai.GenerativeModel("gemini-1.5-flash")
response = model.generate_content("Give me python code to sort a list", stream=True)
response = model.generate_content("Write a story about a magic backpack.", stream=True)
for chunk in response:
print(chunk.text)
print("_" * 80)
Expand Down