kenken999 commited on
Commit
67028b6
·
1 Parent(s): 6013674
chat_history.db CHANGED
Binary files a/chat_history.db and b/chat_history.db differ
 
controllers/gpt_enginner20240624162432 ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit 1a40b143311bcdbd6911732f96f0a3ee9d71ff8d
mysite/routers/fastapi.py CHANGED
@@ -112,6 +112,7 @@ def setup_webhook_routes(app: FastAPI):
112
  #return
113
  #url = github(token,foldername)
114
  try:
 
115
  for event in events:
116
  if event["type"] == "message" and event["message"]["type"] == "text":
117
  user_id = event["source"]["userId"]
@@ -244,15 +245,18 @@ def setup_webhook_routes(app: FastAPI):
244
  link_text = "データを確認する"
245
  link_url = "https://kenken999-php.hf.space/diamondprice_list.php"
246
  #test_set_lide(subtitle, text)
247
- thread_name = send_google_chat_card_thread(webhook_url, title, subtitle, link_text, link_url,thread_name)
248
- thread_name = send_google_chat_card_thread(webhook_url, title, subtitle, link_text, link_url,thread_name)
 
 
249
  #return
250
  #test case
251
  #########################################################################
252
  first_line = text.split('\n')[0]
253
  #test_prompt
254
  res = test_prompt("返信は必ず日本語でして下さい \r\n"+prompt_res,text)
255
- thread_name = send_google_chat_card_thread(webhook_url, "プロンプトテスト "+first_line, str(res), link_text, link_url,thread_name)
 
256
  #thread_name = send_google_chat_card_thread(webhook_url, title, subtitle, link_text, link_url,thread_name)
257
  now = datetime.now()
258
  yyyymmddhis = now.strftime('%Y%m%d%H%M%S')
@@ -303,7 +307,8 @@ def setup_webhook_routes(app: FastAPI):
303
  # execute open interpreter
304
  #########################################################################
305
  full_response,history = chat_with_interpreter_no_stream(prompt_for_create_system+"\r\n"+res)
306
- thread_name = send_google_chat_card_thread(webhook_url, f"自動設定開始 {res}", str(full_response), link_text, link_url,thread_name)
 
307
  #########################################################################
308
  #ダイヤ金額計算
309
  from babyagi.classesa.diamond import calculate
@@ -314,15 +319,16 @@ def setup_webhook_routes(app: FastAPI):
314
  link_text = "データを確認する"
315
  link_url = "https://kenken999-php.hf.space/diamondprice_list.php"
316
  #test_set_lide(subtitle, text)
317
- thread_name = send_google_chat_card_thread(webhook_url, title, subtitle, link_text, link_url,thread_name)
 
318
  #########################################################################
319
  from babyagi.babyagi import completion
320
  #import tempfile
321
- #text = text.replace("\r\n","")
322
  # コマンドを構築
323
  command = f"""make runbabyagi "{text}に対して、より良いチャットボットでのQAプランデータ設定の提案を日本語で作成してください" {thread_name}"""
324
 
325
-
326
  proc = subprocess.Popen(
327
  command,
328
  stdin=subprocess.PIPE,
@@ -331,7 +337,7 @@ def setup_webhook_routes(app: FastAPI):
331
  text=True,
332
  shell=True
333
  )
334
-
335
 
336
 
337
  #prompt_res_agi = completion("日本語で下記のプランを考えて "+res)
 
112
  #return
113
  #url = github(token,foldername)
114
  try:
115
+ DEBUG==0
116
  for event in events:
117
  if event["type"] == "message" and event["message"]["type"] == "text":
118
  user_id = event["source"]["userId"]
 
245
  link_text = "データを確認する"
246
  link_url = "https://kenken999-php.hf.space/diamondprice_list.php"
247
  #test_set_lide(subtitle, text)
248
+ if DEUBUG==1:
249
+ thread_name = send_google_chat_card_thread(webhook_url, title, subtitle, link_text, link_url,thread_name)
250
+
251
+ #thread_name = send_google_chat_card_thread(webhook_url, title, subtitle, link_text, link_url,thread_name)
252
  #return
253
  #test case
254
  #########################################################################
255
  first_line = text.split('\n')[0]
256
  #test_prompt
257
  res = test_prompt("返信は必ず日本語でして下さい \r\n"+prompt_res,text)
258
+ if DEUBUG==1:
259
+ thread_name = send_google_chat_card_thread(webhook_url, "プロンプトテスト "+first_line, str(res), link_text, link_url,thread_name)
260
  #thread_name = send_google_chat_card_thread(webhook_url, title, subtitle, link_text, link_url,thread_name)
261
  now = datetime.now()
262
  yyyymmddhis = now.strftime('%Y%m%d%H%M%S')
 
307
  # execute open interpreter
308
  #########################################################################
309
  full_response,history = chat_with_interpreter_no_stream(prompt_for_create_system+"\r\n"+res)
310
+ if DEBUG==1:
311
+ thread_name = send_google_chat_card_thread(webhook_url, f"自動設定開始 {res}", str(full_response), link_text, link_url,thread_name)
312
  #########################################################################
313
  #ダイヤ金額計算
314
  from babyagi.classesa.diamond import calculate
 
319
  link_text = "データを確認する"
320
  link_url = "https://kenken999-php.hf.space/diamondprice_list.php"
321
  #test_set_lide(subtitle, text)
322
+ if DEBUG==1:
323
+ thread_name = send_google_chat_card_thread(webhook_url, title, subtitle, link_text, link_url,thread_name)
324
  #########################################################################
325
  from babyagi.babyagi import completion
326
  #import tempfile
327
+ text = text.replace("\r\n","")
328
  # コマンドを構築
329
  command = f"""make runbabyagi "{text}に対して、より良いチャットボットでのQAプランデータ設定の提案を日本語で作成してください" {thread_name}"""
330
 
331
+ """
332
  proc = subprocess.Popen(
333
  command,
334
  stdin=subprocess.PIPE,
 
337
  text=True,
338
  shell=True
339
  )
340
+ """
341
 
342
 
343
  #prompt_res_agi = completion("日本語で下記のプランを考えて "+res)