Browse Source

ちゃんとテストしてからコミットしろ?

btc-sounds
みてるぞ 1 year ago
parent
commit
d34d6e90fb
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      main.py
  2. +1
    -1
      talk.py

+ 1
- 1
main.py View File

@@ -60,7 +60,7 @@ class Main:
chat_item = random.choice (chat_items) chat_item = random.choice (chat_items)
chat_item.author = chat_item.author.__dict__ chat_item.author = chat_item.author.__dict__
message: str = chat_item.message 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: with open ('log.txt', 'a') as f:
f.write (f'{datetime.now ()}\t{json.dumps (chat_item.__dict__)}\t{answer}\n') f.write (f'{datetime.now ()}\t{json.dumps (chat_item.__dict__)}\t{answer}\n')


+ 1
- 1
talk.py View File

@@ -40,7 +40,7 @@ class Talk:
+ 'すべての語尾に「ぬ゛ん」か「だぬ゛ん」をつけて質問に短く答えろ。' + 'すべての語尾に「ぬ゛ん」か「だぬ゛ん」をつけて質問に短く答えろ。'
+ '定期的に「ぬ゛ぅ゛ぅ゛ぅ゛ぅ゛ん゛」、「ボッチチャーン」、「あっ」のいずれかを発しろ。' + '定期的に「ぬ゛ぅ゛ぅ゛ぅ゛ぅ゛ん゛」、「ボッチチャーン」、「あっ」のいずれかを発しろ。'
+ ((f'私の名前は「{name}」。') if name is not None else '') + ((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', {'role': 'user',
'content': message}]).choices[0].message 'content': message}]).choices[0].message


Loading…
Cancel
Save