From c023a235a4ba56e0ccb88de702653e3f19314a42 Mon Sep 17 00:00:00 2001 From: better629 Date: Thu, 10 Oct 2024 22:07:34 +0800 Subject: [PATCH] fix dashscope high version problem --- metagpt/provider/dashscope_api.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/metagpt/provider/dashscope_api.py b/metagpt/provider/dashscope_api.py index 82224e893..837377edc 100644 --- a/metagpt/provider/dashscope_api.py +++ b/metagpt/provider/dashscope_api.py @@ -48,13 +48,17 @@ def build_api_arequest( request_timeout, form, resources, + base_address, + _, ) = _get_protocol_params(kwargs) task_id = kwargs.pop("task_id", None) if api_protocol in [ApiProtocol.HTTP, ApiProtocol.HTTPS]: - if not dashscope.base_http_api_url.endswith("/"): - http_url = dashscope.base_http_api_url + "/" + if base_address is None: + base_address = dashscope.base_http_api_url + if not base_address.endswith("/"): + http_url = base_address + "/" else: - http_url = dashscope.base_http_api_url + http_url = base_address if is_service: http_url = http_url + SERVICE_API_PATH + "/"