mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-01-25 08:13:30 +08:00
* feat: add qwen-api * 使Qwen API支持temperature参数;添加测试用例 * 将online-api的sdk列为可选依赖 --------- Co-authored-by: liunux4odoo <liunux@qq.com>
20 lines
509 B
Python
20 lines
509 B
Python
import sys
|
|
from pathlib import Path
|
|
root_path = Path(__file__).parent.parent.parent
|
|
sys.path.append(str(root_path))
|
|
|
|
from server.model_workers.qwen import request_qwen_api
|
|
from pprint import pprint
|
|
import pytest
|
|
|
|
|
|
@pytest.mark.parametrize("version", ["qwen-turbo"])
|
|
def test_qwen(version):
|
|
messages = [{"role": "user", "content": "hello"}]
|
|
print("\n" + version + "\n")
|
|
|
|
for x in request_qwen_api(messages, version=version):
|
|
print(type(x))
|
|
pprint(x)
|
|
assert x["code"] == 200
|