Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -103,7 +103,6 @@ def generate_and_upload_image(prompt: str) -> str:
|
|
| 103 |
็ๆๅ็็ URLใ
|
| 104 |
"""
|
| 105 |
try:
|
| 106 |
-
# genai_client = genai.Client(api_key=google_api)
|
| 107 |
response = genai_client.models.generate_content(
|
| 108 |
model="gemini-2.0-flash-exp",
|
| 109 |
contents=prompt,
|
|
@@ -246,11 +245,10 @@ def handle_message(event):
|
|
| 246 |
# ้่กไปฃ็ไบบ
|
| 247 |
response = agent_executor.invoke(agent_input)
|
| 248 |
out = response["output"]
|
| 249 |
-
|
| 250 |
if 'htts' in out:
|
| 251 |
-
img_tmp = out.split('https')[1]
|
| 252 |
-
|
| 253 |
-
image_url = img_tmp.split('png')[0]
|
| 254 |
print('image_url',image_url)
|
| 255 |
line_bot_api.push_message(
|
| 256 |
event.source.user_id,
|
|
|
|
| 103 |
็ๆๅ็็ URLใ
|
| 104 |
"""
|
| 105 |
try:
|
|
|
|
| 106 |
response = genai_client.models.generate_content(
|
| 107 |
model="gemini-2.0-flash-exp",
|
| 108 |
contents=prompt,
|
|
|
|
| 245 |
# ้่กไปฃ็ไบบ
|
| 246 |
response = agent_executor.invoke(agent_input)
|
| 247 |
out = response["output"]
|
| 248 |
+
print('out')
|
| 249 |
if 'htts' in out:
|
| 250 |
+
img_tmp = 'https'+out.split('https')[1]
|
| 251 |
+
image_url = img_tmp.split('png')[0]+'png'
|
|
|
|
| 252 |
print('image_url',image_url)
|
| 253 |
line_bot_api.push_message(
|
| 254 |
event.source.user_id,
|