suqingdong / sparkapi

讯飞星火认知大模型API - Python SDK
https://suqingdong.github.io/sparkapi/
51 stars 6 forks source link

get_completion_from_messages有问题,会漏数据的 #5

Closed compilelife closed 7 months ago

compilelife commented 10 months ago
while True:
            res = json.loads(wss.recv())
            if res['header']['status'] == 2:
                break
            content = res['payload']['choices']['text'][0]['content']
            yield content

当status为2的时候,payload还有有效数据

onlytiancai commented 7 months ago

我也遇到些返回半拉数据的情况

onlytiancai commented 7 months ago

把 if break这两行放在最下面就行

suqingdong commented 7 months ago

已修复~