mirror of
https://github.com/open-webui/open-webui
synced 2025-05-15 02:56:09 +00:00
refac
This commit is contained in:
parent
3dd10f2ca0
commit
fc71f441c4
@ -26,7 +26,6 @@ async def convert_streaming_response_ollama_to_openai(ollama_streaming_response)
|
|||||||
)
|
)
|
||||||
|
|
||||||
line = f"data: {json.dumps(data)}\n\n"
|
line = f"data: {json.dumps(data)}\n\n"
|
||||||
if done:
|
|
||||||
line += "data: [DONE]\n\n"
|
|
||||||
|
|
||||||
yield line
|
yield line
|
||||||
|
|
||||||
|
yield "data: [DONE]\n\n"
|
||||||
|
@ -78,8 +78,7 @@
|
|||||||
|
|
||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
if (line !== '') {
|
if (line !== '') {
|
||||||
if (line === 'data: [DONE]') {
|
if (line.includes('[DONE]')) {
|
||||||
// responseMessage.done = true;
|
|
||||||
console.log('done');
|
console.log('done');
|
||||||
} else {
|
} else {
|
||||||
let data = JSON.parse(line.replace(/^data: /, ''));
|
let data = JSON.parse(line.replace(/^data: /, ''));
|
||||||
|
Loading…
Reference in New Issue
Block a user