支持流式回复与按行消息解析
Some checks failed
Pyright Lint / Pyright Lint (push) Has been cancelled
Ruff Lint / Ruff Lint (push) Has been cancelled

This commit is contained in:
FuQuan233 2026-07-30 18:08:18 +08:00
parent 0d6771eca6
commit f091497613
10 changed files with 644 additions and 45 deletions

View file

@ -83,7 +83,7 @@ class ToolLoopTests(unittest.IsolatedAsyncioTestCase):
client = FakeClient()
mcp_client = FakeMCPClient()
transcript = [{"role": "user", "content": "hello"}]
message = await service._run_tool_loop(
completion = await service._run_tool_loop(
client=cast(Any, client),
preset=preset,
mcp_client=cast(Any, mcp_client),
@ -94,7 +94,7 @@ class ToolLoopTests(unittest.IsolatedAsyncioTestCase):
is_group=False,
)
assert message.content == "final answer"
assert completion.message.content == "final answer"
assert mcp_client.call_count == 2
assert len(client.chat.completions.calls) == 5
assert "tools" not in client.chat.completions.calls[-1]