Update app.py
Browse files
app.py
CHANGED
@@ -39,8 +39,8 @@ async def echo(message, history, state, persona):
|
|
39 |
if attached_file is None:
|
40 |
path_gcp = await client.files.upload(path=path_local)
|
41 |
path_wrap = types.Part.from_uri(
|
42 |
-
file_uri=path_gcp.
|
43 |
-
)
|
44 |
state["attached_files"].append({
|
45 |
"name": filename,
|
46 |
"path_local": path_local,
|
@@ -54,11 +54,8 @@ async def echo(message, history, state, persona):
|
|
54 |
user_message_parts = [types.Part.from_text(text=message['text'])]
|
55 |
if attached_file: user_message_parts.append(attached_file)
|
56 |
user_message = [types.Content(role='user', parts=user_message_parts)]
|
57 |
-
print(1)
|
58 |
-
print(user_message)
|
59 |
|
60 |
state['messages'] = state['messages'] + user_message
|
61 |
-
print(2)
|
62 |
print(state['messages'])
|
63 |
|
64 |
response_chunks = ""
|
|
|
39 |
if attached_file is None:
|
40 |
path_gcp = await client.files.upload(path=path_local)
|
41 |
path_wrap = types.Part.from_uri(
|
42 |
+
file_uri=path_gcp.uri, mime_type=path_gcp.mime_type
|
43 |
+
)
|
44 |
state["attached_files"].append({
|
45 |
"name": filename,
|
46 |
"path_local": path_local,
|
|
|
54 |
user_message_parts = [types.Part.from_text(text=message['text'])]
|
55 |
if attached_file: user_message_parts.append(attached_file)
|
56 |
user_message = [types.Content(role='user', parts=user_message_parts)]
|
|
|
|
|
57 |
|
58 |
state['messages'] = state['messages'] + user_message
|
|
|
59 |
print(state['messages'])
|
60 |
|
61 |
response_chunks = ""
|