瀏覽代碼

add base url for moonshot model (#7360)

tags/0.7.1
噢哎哟喂 1 年之前
父節點
當前提交
baaa3f7f42
沒有連結到貢獻者的電子郵件帳戶。

+ 2
- 1
api/core/model_runtime/model_providers/moonshot/llm/llm.py 查看文件

@@ -84,7 +84,8 @@ class MoonshotLargeLanguageModel(OAIAPICompatLargeLanguageModel):

def _add_custom_parameters(self, credentials: dict) -> None:
credentials['mode'] = 'chat'
credentials['endpoint_url'] = 'https://api.moonshot.cn/v1'
if 'endpoint_url' not in credentials or credentials['endpoint_url'] == "":
credentials['endpoint_url'] = 'https://api.moonshot.cn/v1'

def _add_function_call(self, model: str, credentials: dict) -> None:
model_schema = self.get_model_schema(model, credentials)

+ 8
- 0
api/core/model_runtime/model_providers/moonshot/moonshot.yaml 查看文件

@@ -31,6 +31,14 @@ provider_credential_schema:
placeholder:
zh_Hans: 在此输入您的 API Key
en_US: Enter your API Key
- variable: endpoint_url
label:
en_US: API Base
type: text-input
required: false
placeholder:
zh_Hans: Base URL, 如:https://api.moonshot.cn/v1
en_US: Base URL, e.g. https://api.moonshot.cn/v1
model_credential_schema:
model:
label:

Loading…
取消
儲存