MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / test_stop_seq_exceed_num

Function test_stop_seq_exceed_num

tests/ce/server/test_evil_cases.py:113–124  ·  view source on GitHub ↗

stop 字段包含超过 FD_MAX_STOP_SEQS_NUM 个元素,服务应报错

()

Source from the content-addressed store, hash-verified

111
112
113def test_stop_seq_exceed_num():
114 """stop 字段包含超过 FD_MAX_STOP_SEQS_NUM 个元素,服务应报错"""
115 data = {
116 "stream": False,
117 "messages": [{"role": "user", "content": "非洲的首都是?"}],
118 "top_p": 0,
119 "stop": ["11", "22", "33", "44", "55", "66", "77"],
120 }
121 payload = build_request_payload(TEMPLATE, data)
122 resp = send_request(URL, payload).json()
123 assert resp.get("error").get("type") == "invalid_request_error", "stop 超出个数应触发异常"
124 assert "exceeds the limit max_stop_seqs_num" in resp.get("error").get("message", ""), "未返回预期的报错信息"
125
126
127def test_stop_seq_exceed_length():

Callers

nothing calls this directly

Calls 3

build_request_payloadFunction · 0.90
send_requestFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected