We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d8e410 commit 1efbcefCopy full SHA for 1efbcef
google/generativeai/client.py
@@ -73,15 +73,7 @@ def create_file(
73
request = self._discovery_api.media().upload(body={"file": file}, media_body=media)
74
result = request.execute()
75
76
- allowed_keys = set(glm.File.__annotations__)
77
-
78
- return glm.File(
79
- {
80
- re.sub("[A-Z]", lambda ch: f"_{ch.group(0).lower()}", key): value
81
- for key, value in result["file"].items()
82
- if key in allowed_keys
83
- }
84
- )
+ return self.get_file({"name": result["name"]})
85
86
87
class FileServiceAsyncClient(glm.FileServiceAsyncClient):
0 commit comments