Skip to content

Commit

Permalink
Cleanup files.py (#402)
Browse files Browse the repository at this point in the history
Co-authored-by: Shilpa Kancharla <snkancharla@google.com>
  • Loading branch information
MarkDaoust and shilpakancharla authored Jul 3, 2024
1 parent 45fcbdf commit 9282959
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions samples/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def test_files_create_text(self):
[myfile, "\n\n", "Can you add a few more lines to this poem?"]
)
print(f"{result.text=}")
<<<<<<< MarkDaoust-patch-24
# [END files_create]
=======
# [END files_create_text]

def test_files_create_image(self):
Expand All @@ -55,6 +58,7 @@ def test_files_create_audio(self):
result = model.generate_content([myfile, "Describe this audio clip"])
print(f"{result.text=}")
# [END files_create_audio]
>>>>>>> main

def test_files_create_video(self):
# [START files_create_video]
Expand Down Expand Up @@ -82,6 +86,16 @@ def test_files_list(self):
print(" ", f.name)
# [END files_list]

def test_files_get(self):
# [START files_get]
myfile = genai.upload_file(media / "poem.txt")
file_name = myfile.name
print(file_name) # "files/*"

myfile = genai.get_file(file_name)
print(myfile)
# [END files_get]

def test_files_delete(self):
# [START files_delete]
myfile = genai.upload_file(media / "poem.txt")
Expand All @@ -96,15 +110,6 @@ def test_files_delete(self):
pass
# [END files_delete]

def test_files_get(self):
# [START files_get]
myfile = genai.upload_file(media / "poem.txt")
file_name = myfile.name
print(file_name) # "files/*"

myfile = genai.get_file(file_name)
print(myfile)
# [END files_get]


if __name__ == "__main__":
Expand Down

0 comments on commit 9282959

Please sign in to comment.