mirror of
https://github.com/katanemo/plano.git
synced 2026-07-11 16:12:13 +02:00
fix tests
This commit is contained in:
parent
e2edeedf55
commit
e48918259e
1 changed files with 4 additions and 2 deletions
|
|
@ -42,9 +42,11 @@ def test_prompt_gateway(stream):
|
||||||
assert "role" in choices[0]["delta"]
|
assert "role" in choices[0]["delta"]
|
||||||
role = choices[0]["delta"]["role"]
|
role = choices[0]["delta"]["role"]
|
||||||
assert role == "assistant"
|
assert role == "assistant"
|
||||||
tool_calls = choices[0].get("delta", {}).get("tool_calls", [])
|
print(f"choices: {choices}")
|
||||||
|
tool_call_str = choices[0].get("delta", {}).get("content", "")
|
||||||
|
tool_calls = json.loads(tool_call_str).get("tool_calls", [])
|
||||||
assert len(tool_calls) > 0
|
assert len(tool_calls) > 0
|
||||||
tool_call = tool_calls[0]["function"]
|
tool_call = tool_calls[0]
|
||||||
location = tool_call["arguments"]["location"]
|
location = tool_call["arguments"]["location"]
|
||||||
assert expected_tool_call["arguments"]["location"] in location.lower()
|
assert expected_tool_call["arguments"]["location"] in location.lower()
|
||||||
del expected_tool_call["arguments"]["location"]
|
del expected_tool_call["arguments"]["location"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue