openai-scf-proxy icon indicating copy to clipboard operation
openai-scf-proxy copied to clipboard

当回答过长时,代理服务器自动关闭连接,日志错误显示499错误

Open BlakrPander opened this issue 9 months ago • 0 comments

日志如下:

SCF_FunctionName:OpenAI-Proxy
SCF_Namespace:default
SCF_StartTime:1698287749552
SCF_RequestId:***
SCF_Duration:14312
SCF_Alias:$DEFAULT
SCF_Qualifier:$LATEST
SCF_LogTime:1698287764481804310
SCF_RetryNum:0
SCF_MemUsage:18266024.00
SCF_Level:INFO
SCF_Message:ERROR RequestId: 4280633807e4294e004bc5642e9f0709 Result: {"errorCode":-1,"errorMessage":"Request was canceled by client or apigw timed out earlier than function.","statusCode":499}
SCF_Type:Platform
SCF_StatusCode:499

已经将超时时间修改为900了,但是还是会出现这种错误,使用同样prompts对官方api_base发送时虽然回答时间很长,但不会出现中断现象,请问该如何解决? 测试代码如下:

prompt = "请你用python写一段素数筛"
    response=openai.ChatCompletion.create(
        api_key="sk-***",
        api_base="https://service-***.usw.apigw.tencentcs.com",
        model="gpt-3.5-turbo",
        messages=[
            {"role":"user","content":prompt},
        ]
    )
    answer=response.choices[0].message.content
    print(answer)
    ```

BlakrPander avatar Oct 26 '23 03:10 BlakrPander