Update app.py
Browse files
app.py
CHANGED
@@ -38,11 +38,14 @@ async def echo(message, history, state, persona):
|
|
38 |
attached_file = find_attached_file(filename, state["attached_files"])
|
39 |
if attached_file is None:
|
40 |
path_gcp = await client.files.upload(path=path_local)
|
|
|
|
|
|
|
41 |
state["attached_files"].append({
|
42 |
"name": filename,
|
43 |
"path_local": path_local,
|
44 |
"gcp_entity": path_gcp,
|
45 |
-
"path_gcp": path_gcp
|
46 |
"mime_type=": path_gcp.mime_type,
|
47 |
"expiration_time": path_gcp.expiration_time,
|
48 |
})
|
|
|
38 |
attached_file = find_attached_file(filename, state["attached_files"])
|
39 |
if attached_file is None:
|
40 |
path_gcp = await client.files.upload(path=path_local)
|
41 |
+
path_gcp = types.Part.from_uri(
|
42 |
+
file_uri=path_gcp.name, mime_type=path_gcp.mime_type
|
43 |
+
),
|
44 |
state["attached_files"].append({
|
45 |
"name": filename,
|
46 |
"path_local": path_local,
|
47 |
"gcp_entity": path_gcp,
|
48 |
+
"path_gcp": path_gcp,
|
49 |
"mime_type=": path_gcp.mime_type,
|
50 |
"expiration_time": path_gcp.expiration_time,
|
51 |
})
|