rusinopp commited on
Commit
422668a
·
verified ·
1 Parent(s): 9d71992

Upload interface_controller.py

Browse files
Files changed (1) hide show
  1. interface_controller.py +13 -9
interface_controller.py CHANGED
@@ -1,13 +1,17 @@
1
 
2
- import json
3
- from dialogue_engine import DialogueEngine
4
 
5
- with open("persona_keisuke.json", "r", encoding="utf-8") as f:
6
- persona = json.load(f)
7
- with open("keisuke_response_template.json", "r", encoding="utf-8") as f:
8
- templates = json.load(f)
9
 
10
- engine = DialogueEngine(persona, templates)
 
 
 
11
 
12
- def chat(user_input):
13
- return engine.respond(user_input)
 
 
 
1
 
2
+ from external_api_engine import call_external_api
3
+ from cui_display import display_cui_response
4
 
5
+ def chat(user_input):
6
+ # 外部APIでけいすけさんの返答を取得
7
+ response_text = call_external_api(user_input)
 
8
 
9
+ # ↓ここではEmotionCoreなどの解析は仮定(固定で記述)
10
+ interpretation = "安心したいという内面の訴え"
11
+ intention = "静かに寄り添って励ましたい"
12
+ persona = "感情人格(Keisuke-Emotion)"
13
 
14
+ # CUI形式で表示ログ生成
15
+ cui_log = display_cui_response(user_input, interpretation, intention, persona, response_text)
16
+
17
+ return cui_log