Skip to content

Commit e70123f

Browse files
committed
Extend streaming test with another tool call
1 parent cbe4fab commit e70123f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/test/llm/output_parsers/qwen3coder_output_parser_test.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,19 @@ TEST_F(Qwen3CoderOutputParserTest, StreamingSimpleToolCall) {
560560
{"</pa", ov::genai::GenerationFinishReason::NONE, std::nullopt},
561561
{"rameter>\n", ov::genai::GenerationFinishReason::NONE, std::nullopt},
562562
{"</function>", ov::genai::GenerationFinishReason::NONE, std::nullopt},
563-
{"</tool_call>", ov::genai::GenerationFinishReason::NONE, R"({"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"arg1\": \"STRING_VALUE\"}"}}]}})"}};
563+
{"</tool_call>", ov::genai::GenerationFinishReason::NONE, R"({"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"arg1\": \"STRING_VALUE\"}"}}]}})"},
564+
{" POTENTIALLY EXISINT CONTENT", ov::genai::GenerationFinishReason::NONE, std::nullopt},
565+
{" <tool", ov::genai::GenerationFinishReason::NONE, std::nullopt},
566+
{" <tool_call>\n", ov::genai::GenerationFinishReason::NONE, std::nullopt},
567+
{"<function=string_tool", ov::genai::GenerationFinishReason::NONE, std::nullopt},
568+
{">\n", ov::genai::GenerationFinishReason::NONE, R"({"delta":{"tool_calls":[{"id":"XXXXXXXXX","type":"function","index":1,"function":{"name":"string_tool"}}]}})"},
569+
{"<parameter=arg1>\n", ov::genai::GenerationFinishReason::NONE, std::nullopt},
570+
{"\n", ov::genai::GenerationFinishReason::NONE, std::nullopt},
571+
{"ANOTHER_STRING_VALUE\n", ov::genai::GenerationFinishReason::NONE, std::nullopt},
572+
{"</parameter>\n", ov::genai::GenerationFinishReason::NONE, std::nullopt},
573+
{"</function>", ov::genai::GenerationFinishReason::NONE, std::nullopt},
574+
{"</tool_call>", ov::genai::GenerationFinishReason::NONE, R"({"delta":{"tool_calls":[{"index":1,"function":{"arguments":"{\"arg1\": \"\nANOTHER_STRING_VALUE\"}"}}]}})"}
575+
};
564576
for (const auto& [chunk, finishReason, expectedDelta] : chunkToDeltaVec) {
565577
i++;
566578
std::optional<rapidjson::Document> doc = outputParser->parseChunk(chunk, true, ov::genai::GenerationFinishReason::NONE);

0 commit comments

Comments
 (0)