mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-07 01:22:59 +08:00
[Feature] add tool parser (#3518)
* [Feature] Pass through the `chat_template_kwargs` to the data processing module (#3421)
* fix chat_template_args
* fix args
* add offline
* add offline
* fix
* fix
* fix default enable_thinking value
* fix default enable_thinking value
* modify condition
* Revert "modify condition"
This reverts commit 26430bdeb1
.
* fix unit test
* add Tool Parser (#3272)
* add tool-parser
* add tool-parser
* add tool parser
* add tool parser
* fix
* add offline
* add offline
* fix
* parsers:tool&reasoning
* 修改tool parser名称·
* update
* fix reasoning-parser
* add requirements
* fix finish reason
* fix
* fix reasoning-parser
* fix
* fix
* fix
* fix
* fix
---------
Co-authored-by: zhuzixuan <zhuzixuan@baidu.com>
* [Feature] add tool parser (#3483)
* add tool parser
* add x1 enable_thinking
* restart ci
* fix vl reasoning parser
* modify call style
* modify call style
* add offline enablethinking
* fix completion
* fix
* fix unit test
* fix unit test
* fix unit test
* fix vl reasoning parser
* fix vl reasoning parser
* fix unit test
---------
Co-authored-by: zhuzixuan <zhuzixuan@baidu.com>
This commit is contained in:
@@ -18,9 +18,9 @@ class TestOpenAIServingCompletion(unittest.TestCase):
|
||||
# 创建一个OpenAIServingCompletion实例
|
||||
serving_completion = OpenAIServingCompletion(engine_client, "pid", "ips", 360)
|
||||
# 创建一个模拟的output,并设置finish_reason为"tool_calls"
|
||||
output = {"finish_reason": "tool_calls"}
|
||||
output = {"tool_call": True}
|
||||
# 调用calc_finish_reason方法
|
||||
result = serving_completion.calc_finish_reason(None, 100, output)
|
||||
result = serving_completion.calc_finish_reason(None, 100, output, False)
|
||||
# 断言结果为"tool_calls"
|
||||
assert result == "tool_calls"
|
||||
|
||||
@@ -31,9 +31,9 @@ class TestOpenAIServingCompletion(unittest.TestCase):
|
||||
# 创建一个OpenAIServingCompletion实例
|
||||
serving_completion = OpenAIServingCompletion(engine_client, "pid", "ips", 360)
|
||||
# 创建一个模拟的output,并设置finish_reason为其他值
|
||||
output = {"finish_reason": "other_reason"}
|
||||
output = {"tool_call": False}
|
||||
# 调用calc_finish_reason方法
|
||||
result = serving_completion.calc_finish_reason(None, 100, output)
|
||||
result = serving_completion.calc_finish_reason(None, 100, output, False)
|
||||
# 断言结果为"stop"
|
||||
assert result == "stop"
|
||||
|
||||
@@ -45,7 +45,7 @@ class TestOpenAIServingCompletion(unittest.TestCase):
|
||||
# 创建一个模拟的output
|
||||
output = {}
|
||||
# 调用calc_finish_reason方法
|
||||
result = serving_completion.calc_finish_reason(100, 100, output)
|
||||
result = serving_completion.calc_finish_reason(100, 100, output, False)
|
||||
# 断言结果为"length"
|
||||
assert result == "length"
|
||||
|
||||
|
Reference in New Issue
Block a user