Do not parse SSE events if not streaming
When response of Anthropic model includes `data:` and even if the request isn't streaming, `parse_sse_events` will still try to parse the response. It can fail since the format of the response is not really in the proper SSE format expected. We also don't need to parse SSE events if we're not streaming. To fix that, we check if call for `perform_completion_request` and `perform_messages_request` have `stream` as `true`. If not, then we skip calling `parse_sse_events`. Changelog: fixed EE: true
想要评论请 注册 或 登录