支持ghcproxy
This commit is contained in:
@@ -105,10 +105,12 @@ async def chat_completions(
|
||||
|
||||
# First, collect all chunks to detect if there are tool calls
|
||||
async for chunk in stream_llm_api(messages_to_llm, settings, log_id):
|
||||
logger.info(f"sse_result: {chunk}")
|
||||
raw_chunks.append(chunk)
|
||||
# Extract content from SSE chunks
|
||||
parsed = _parse_sse_data(chunk)
|
||||
if parsed and parsed.get("type") != "done":
|
||||
logger.info(f"sse_result_data: {parsed}")
|
||||
if parsed and ( parsed.get("type") != "done" or parsed.get("choices").get("finish_reason") == "stop" ):
|
||||
choices = parsed.get("choices")
|
||||
if choices and len(choices) > 0:
|
||||
delta = choices[0].get("delta")
|
||||
|
||||
Reference in New Issue
Block a user