diff --git a/main.py b/main.py index 6d97398..5642648 100644 --- a/main.py +++ b/main.py @@ -60,7 +60,7 @@ class Main: chat_item = random.choice (chat_items) chat_item.author = chat_item.author.__dict__ message: str = chat_item.message - answer: str = Talk.main (message, chat_item.author.name) + answer: str = Talk.main (message, chat_item.author['name']) with open ('log.txt', 'a') as f: f.write (f'{datetime.now ()}\t{json.dumps (chat_item.__dict__)}\t{answer}\n') diff --git a/talk.py b/talk.py index 7e78881..2cece2a 100644 --- a/talk.py +++ b/talk.py @@ -40,7 +40,7 @@ class Talk: + 'すべての語尾に「ぬ゛ん」か「だぬ゛ん」をつけて質問に短く答えろ。' + '定期的に「ぬ゛ぅ゛ぅ゛ぅ゛ぅ゛ん゛」、「ボッチチャーン」、「あっ」のいずれかを発しろ。' + ((f'私の名前は「{name}」。') if name is not None else '') - + f'現在日時{datetime.now ().strftime ("%Y/%m/%d %H:%M:%S")}'}, + + f'現在日時{datetime.now ().strftime ("%Y/%m/%d %H:%M:%S")}')}, {'role': 'user', 'content': message}]).choices[0].message