MCPcopy
hub / github.com/liangliangyy/DjangoBlog / chat

Method chat

servermanager/api/commonapi.py:18–25  ·  view source on GitHub ↗
(prompt)

Source from the content-addressed store, hash-verified

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
28class CommandHandler:

Callers 3

test_chat_gptMethod · 0.80
handlerMethod · 0.80
commonapi.pyFile · 0.80

Calls 1

createMethod · 0.80

Tested by 1

test_chat_gptMethod · 0.64