Spaces:
Sleeping
Sleeping
fda
Browse files- mysite/routers/fastapi.py +11 -22
mysite/routers/fastapi.py
CHANGED
@@ -322,28 +322,17 @@ def setup_webhook_routes(app: FastAPI):
|
|
322 |
# コマンドを構築
|
323 |
command = f"""make runbabyagi "{text}に対して、より良いチャットボットでのQAプランデータ設定の提案を日本語で作成してください" {thread_name}"""
|
324 |
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
#if proc.returncode != 0:
|
337 |
-
# print(f"Command failed with return code {proc.returncode}")
|
338 |
-
# print(f"Error output: {stderr}")
|
339 |
-
# return None
|
340 |
-
|
341 |
-
#thread_name = send_google_chat_card_thread(webhook_url, title, stdout, link_text, link_url, thread_name)
|
342 |
-
#return thread_name
|
343 |
-
|
344 |
-
except Exception as e:
|
345 |
-
print(f"An error occurred: {e}")
|
346 |
-
return None
|
347 |
|
348 |
#prompt_res_agi = completion("日本語で下記のプランを考えて "+res)
|
349 |
#thread_name = send_google_chat_card_thread(webhook_url, title, prompt_res_agi, link_text, link_url,thread_name)
|
|
|
322 |
# コマンドを構築
|
323 |
command = f"""make runbabyagi "{text}に対して、より良いチャットボットでのQAプランデータ設定の提案を日本語で作成してください" {thread_name}"""
|
324 |
|
325 |
+
|
326 |
+
proc = subprocess.Popen(
|
327 |
+
command,
|
328 |
+
stdin=subprocess.PIPE,
|
329 |
+
stdout=subprocess.PIPE,
|
330 |
+
stderr=subprocess.PIPE,
|
331 |
+
text=True,
|
332 |
+
shell=True
|
333 |
+
)
|
334 |
+
|
335 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
336 |
|
337 |
#prompt_res_agi = completion("日本語で下記のプランを考えて "+res)
|
338 |
#thread_name = send_google_chat_card_thread(webhook_url, title, prompt_res_agi, link_text, link_url,thread_name)
|