fix(files): force a final answer before tool cutoff
This commit is contained in:
@@ -159,6 +159,39 @@ class StabilityGuardTests(unittest.IsolatedAsyncioTestCase):
|
||||
["execute_code"],
|
||||
)
|
||||
|
||||
async def test_private_csv_stops_before_openwebui_hard_tool_limit(self):
|
||||
calls = []
|
||||
for index in range(6):
|
||||
calls.extend(
|
||||
[
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"name": "execute_code",
|
||||
"arguments": '{"code":"step %d"}' % index,
|
||||
}
|
||||
}
|
||||
],
|
||||
},
|
||||
{"role": "tool", "content": "ok", "tool_call_id": str(index)},
|
||||
]
|
||||
)
|
||||
body = {
|
||||
"model": "qwen-fast",
|
||||
"tools": [
|
||||
{"type": "function", "function": {"name": "execute_code"}},
|
||||
],
|
||||
"messages": [
|
||||
{"role": "user", "content": "Werte diese CSV aus."},
|
||||
*calls,
|
||||
],
|
||||
}
|
||||
result = await self.guard.inlet(body)
|
||||
self.assertEqual(result["tools"], [])
|
||||
self.assertIn("vorhandenen Ergebnisse", result["messages"][0]["content"])
|
||||
|
||||
|
||||
class AutoToolSelectorTests(unittest.IsolatedAsyncioTestCase):
|
||||
async def asyncSetUp(self):
|
||||
|
||||
Reference in New Issue
Block a user