77b2c0a479
1、加入了NLP三选一:xfaiui、yuan、chatgpt; 2、修复由pyaudio bug导致的录音错误; 3、修改远程音频输入输出设备同时只允许连1个;
11 lines
316 B
Python
11 lines
316 B
Python
from utils import config_util as cfg
|
|
import openai
|
|
|
|
def question(text):
|
|
cfg.load_config()
|
|
openai.api_key = cfg.key_chatgpt_api_key
|
|
prompt = text
|
|
completions = openai.Completion.create(engine="text-davinci-002", prompt=prompt, max_tokens=1024)
|
|
a_msg = completions.choices[0].text
|
|
return a_msg
|