(prompt)
| 16 | |
| 17 | @staticmethod |
| 18 | def chat(prompt): |
| 19 | try: |
| 20 | completion = openai.ChatCompletion.create(model="gpt-3.5-turbo", |
| 21 | messages=[{"role": "user", "content": prompt}]) |
| 22 | return completion.choices[0].message.content |
| 23 | except Exception as e: |
| 24 | logger.error(e) |
| 25 | return "服务器出错了" |
| 26 | |
| 27 | |
| 28 | class CommandHandler: |