From f9b18b596b13fa40780dbd9b860c101b0a26c867 Mon Sep 17 00:00:00 2001 From: crazywoola <427733928@qq.com> Date: Tue, 3 Sep 2024 20:16:40 +0800 Subject: [PATCH 1/2] fix: add default base url --- api/core/tools/provider/builtin/stepfun/tools/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/core/tools/provider/builtin/stepfun/tools/image.py b/api/core/tools/provider/builtin/stepfun/tools/image.py index 5e544aada63b40..91f6e2c188cac1 100644 --- a/api/core/tools/provider/builtin/stepfun/tools/image.py +++ b/api/core/tools/provider/builtin/stepfun/tools/image.py @@ -17,7 +17,7 @@ def _invoke(self, """ invoke tools """ - base_url = self.runtime.credentials.get('stepfun_base_url', None) + base_url = self.runtime.credentials.get('stepfun_base_url', 'https://api.stepfun.com') if not base_url: base_url = None else: From 77b2bf5b069256808b5ed9e4cdd01ef150e7d002 Mon Sep 17 00:00:00 2001 From: crazywoola <427733928@qq.com> Date: Tue, 3 Sep 2024 20:18:07 +0800 Subject: [PATCH 2/2] fix: add default base url --- api/core/tools/provider/builtin/stepfun/tools/image.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/api/core/tools/provider/builtin/stepfun/tools/image.py b/api/core/tools/provider/builtin/stepfun/tools/image.py index 91f6e2c188cac1..c571f546757b94 100644 --- a/api/core/tools/provider/builtin/stepfun/tools/image.py +++ b/api/core/tools/provider/builtin/stepfun/tools/image.py @@ -18,10 +18,7 @@ def _invoke(self, invoke tools """ base_url = self.runtime.credentials.get('stepfun_base_url', 'https://api.stepfun.com') - if not base_url: - base_url = None - else: - base_url = str(URL(base_url) / 'v1') + base_url = str(URL(base_url) / 'v1') client = OpenAI( api_key=self.runtime.credentials['stepfun_api_key'],