stop 中包含长度超过 FD_STOP_SEQS_MAX_LEN 的元素,服务应报错
()
| 125 | |
| 126 | |
| 127 | def test_stop_seq_exceed_length(): |
| 128 | """stop 中包含长度超过 FD_STOP_SEQS_MAX_LEN 的元素,服务应报错""" |
| 129 | data = { |
| 130 | "stream": False, |
| 131 | "messages": [{"role": "user", "content": "非洲的首都是?"}], |
| 132 | "top_p": 0, |
| 133 | "stop": ["11", "今天天气比明天好多了,请问你会出门还是和我一起玩"], |
| 134 | } |
| 135 | payload = build_request_payload(TEMPLATE, data) |
| 136 | resp = send_request(URL, payload).json() |
| 137 | assert resp.get("error").get("type") == "invalid_request_error", "stop 超出长度应触发异常" |
| 138 | assert "exceeds the limit stop_seqs_max_len" in resp.get("error").get("message", ""), "未返回预期的报错信息" |
| 139 | |
| 140 | |
| 141 | def test_multilingual_input(): |
nothing calls this directly
no test coverage detected