winger
winger
1. 由于config文件里头获取的参数type都是unicode,传入底层的getaddrinfo函数后会报错 getaddrinfo() argument 2 must be integer or string. 所以这里给port做个int转换. 2. 邮件标题是中文的, 需要做一次编码, 避免邮件标题乱码.
好像stream=True并不能满足需求 `import requests import json url = 'http://192.168.9.188:32580/api/conversation/talk' headers = {'Content-Type': 'application/json'} data = {'prompt': 'lisp实现fib,尾递归实现', 'model': 'text-davinci-002-render-sha', 'message_id': '8b0f830e-c3f1-460c-a493-f752bc523ca4', 'parent_message_id': '57074a67-f3a9-4e84-b226-aa20a57089ac', 'conversation_id': '0de327ec-19b3-4b4b-bcd7-b623b3af2d9a', 'stream': 'True'} json_data = json.dumps(data) response...