| 1973 | } | 1973 | } |
| 1974 | | 1974 | |
| 1975 | function getStreamingReply(data) { | 1975 | function getStreamingReply(data) { |
| 1976 | if (oai_settings.chat_completion_source == chat_completion_sources.CLAUDE) { | 1976 | if (oai_settings.chat_completion_source === chat_completion_sources.CLAUDE) { |
| 1977 | return data?.delta?.text || ''; | 1977 | return data?.delta?.text || ''; |
| 1978 | } else if (oai_settings.chat_completion_source == chat_completion_sources.MAKERSUITE) { | 1978 | } else if (oai_settings.chat_completion_source === chat_completion_sources.MAKERSUITE) { |
| 1979 | return data?.candidates?.[0]?.content?.parts?.[0]?.text || ''; | 1979 | return data?.candidates?.[0]?.content?.parts?.[0]?.text || ''; |
| 1980 | } else if (oai_settings.chat_completion_source == chat_completion_sources.COHERE) { | 1980 | } else if (oai_settings.chat_completion_source === chat_completion_sources.COHERE) { |
| 1981 | return data?.delta?.message?.content?.text || data?.delta?.message?.tool_plan || ''; | 1981 | return data?.delta?.message?.content?.text || data?.delta?.message?.tool_plan || ''; |
| 1982 | } else { | 1982 | } else { |
| 1983 | return data.choices?.[0]?.delta?.content ?? data.choices?.[0]?.message?.content ?? data.choices?.[0]?.text ?? ''; | 1983 | return data.choices?.[0]?.delta?.content ?? data.choices?.[0]?.message?.content ?? data.choices?.[0]?.text ?? ''; |