ci(SDK): Add 0.7.0 workflow (#2493)

This commit is contained in:
Fangyin Cheng
2025-03-20 15:27:44 +08:00
committed by GitHub
parent 4af28e40d8
commit 52e41bccc9
56 changed files with 986 additions and 358 deletions

View File

@@ -0,0 +1,3 @@
from ._version import version as __version__ # noqa: F401
__ALL__ = ["__version__"]

View File

@@ -0,0 +1 @@
version = "0.7.0"

View File

@@ -345,7 +345,15 @@ class Service(BaseService[ServeEntity, ServeRequest, ServerResponse]):
model_request = ModelRequest(**payload)
async for output in llm_client.generate_stream(model_request.copy()): # type: ignore
yield f"data:{output.text}\n\n"
text = ""
if output.has_thinking:
text = output.thinking_text
lines = text.split("\n")
text = ">" + "\n>".join(lines)
if output.has_text:
text += output.text
text = text.replace("\n", "\\n")
yield f"data:{text}\n\n"
yield "data:[DONE]\n\n"
except Exception as e:
logger.error(f"Call LLMClient error, {str(e)}, detail: {payload}")