Skip to content

Commit

Permalink
add base url for moonshot model (#7360)
Browse files Browse the repository at this point in the history
  • Loading branch information
oiuv authored Aug 17, 2024
1 parent 4d4af00 commit baaa3f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/core/model_runtime/model_providers/moonshot/llm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def get_customizable_model_schema(self, model: str, credentials: dict) -> AIMode

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)
Expand Down
8 changes: 8 additions & 0 deletions api/core/model_runtime/model_providers/moonshot/moonshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit baaa3f7

Please sign in to comment.