Mc/toolmaxretry (#323)

This commit is contained in:
casty
2024-01-05 14:49:36 -05:00
committed by GitHub
parent 05fcf0b585
commit c16d622e88
2 changed files with 25 additions and 11 deletions
+5 -2
View File
@@ -92,6 +92,7 @@ def test_override_docs():
{
"role": "assistant",
"content": 'Hello, world![{"id": "test_tool", "function": {"arguments": "", "name": "test_tool"}, "type": "function"}]',
"tool_calls": [{"id": "test_tool", "function": {"arguments": "", "name": "test_tool"}, "type": "function"}],
},
),
(
@@ -110,6 +111,7 @@ def test_override_docs():
{
"role": "assistant",
"content": '[{"id": "test_tool", "function": {"arguments": "", "name": "test_tool"}, "type": "function"}]',
"tool_calls": [{"id": "test_tool", "function": {"arguments": "", "name": "test_tool"}, "type": "function"}],
},
),
(
@@ -151,7 +153,7 @@ def test_override_docs():
"tool_calls and no content and function_call",
ChatCompletionMessage(
role="assistant",
content=None,
content="",
function_call=FunctionCall(arguments="", name="test_tool"),
tool_calls=[
ChatCompletionMessageToolCall(
@@ -164,6 +166,7 @@ def test_override_docs():
{
"role": "assistant",
"content": '[{"id": "test_tool", "function": {"arguments": "", "name": "test_tool"}, "type": "function"}]{"arguments": "", "name": "test_tool"}',
"tool_calls": [{"id": "test_tool", "function": {"arguments": "", "name": "test_tool"}, "type": "function"}]
},
),
],
@@ -173,4 +176,4 @@ def test_dump_message(
message: ChatCompletionMessage,
expected: ChatCompletionMessageParam,
):
assert dump_message(message) == expected, name_of_test
assert dump_message(message) == expected, name_of_test