mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 19:36:53 +08:00
@@ -252,7 +252,7 @@ class MoonshotLargeLanguageModel(OAIAPICompatLargeLanguageModel):
|
|||||||
# ignore sse comments
|
# ignore sse comments
|
||||||
if chunk.startswith(":"):
|
if chunk.startswith(":"):
|
||||||
continue
|
continue
|
||||||
decoded_chunk = chunk.strip().removeprefix("data: ")
|
decoded_chunk = chunk.strip().removeprefix("data:").lstrip()
|
||||||
chunk_json = None
|
chunk_json = None
|
||||||
try:
|
try:
|
||||||
chunk_json = json.loads(decoded_chunk)
|
chunk_json = json.loads(decoded_chunk)
|
||||||
|
|||||||
@@ -479,7 +479,7 @@ class OAIAPICompatLargeLanguageModel(_CommonOaiApiCompat, LargeLanguageModel):
|
|||||||
# ignore sse comments
|
# ignore sse comments
|
||||||
if chunk.startswith(":"):
|
if chunk.startswith(":"):
|
||||||
continue
|
continue
|
||||||
decoded_chunk = chunk.strip().removeprefix("data: ")
|
decoded_chunk = chunk.strip().removeprefix("data:").lstrip()
|
||||||
if decoded_chunk == "[DONE]": # Some provider returns "data: [DONE]"
|
if decoded_chunk == "[DONE]": # Some provider returns "data: [DONE]"
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ class StepfunLargeLanguageModel(OAIAPICompatLargeLanguageModel):
|
|||||||
# ignore sse comments
|
# ignore sse comments
|
||||||
if chunk.startswith(":"):
|
if chunk.startswith(":"):
|
||||||
continue
|
continue
|
||||||
decoded_chunk = chunk.strip().removeprefix("data: ")
|
decoded_chunk = chunk.strip().removeprefix("data:").lstrip()
|
||||||
chunk_json = None
|
chunk_json = None
|
||||||
try:
|
try:
|
||||||
chunk_json = json.loads(decoded_chunk)
|
chunk_json = json.loads(decoded_chunk)
|
||||||
|
|||||||
Reference in New Issue
Block a user