Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

fix: Update KIMI model default URL (#2996)

Xiaotian Jin4e5cb57ba64b
diff --git a/camel/models/moonshot_model.py b/camel/models/moonshot_model.py
index 42c79663d..ba27e7f47 100644
--- a/camel/models/moonshot_model.py
+++ b/camel/models/moonshot_model.py
@@ -61,7 +61,9 @@ class MoonshotModel(OpenAICompatibleModel):
api_key (Optional[str], optional): The API key for authenticating with
the Moonshot service. (default: :obj:`None`)
url (Optional[str], optional): The url to the Moonshot service.
- (default: :obj:`https://api.moonshot.cn/v1`)
+ For Chinese users, use :obj:`https://api.moonshot.cn/v1`.
+ For overseas users, the default endpoint will be used.
+ (default: :obj:`https://api.moonshot.ai/v1`)
token_counter (Optional[BaseTokenCounter], optional): Token counter to
use for the model. If not provided, :obj:`OpenAITokenCounter(
ModelType.GPT_4)` will be used.
@@ -82,7 +84,7 @@ class MoonshotModel(OpenAICompatibleModel):
model_type: Union[ModelType, str],
model_config_dict: Optional[Dict[str, Any]] = None,
api_key: Optional[str] = None,
- url: Optional[str] = None,
+ url: Optional[str] = "https://api.moonshot.ai/v1",
token_counter: Optional[BaseTokenCounter] = None,
timeout: Optional[float] = None,
max_retries: int = 3,
@@ -91,10 +93,7 @@ class MoonshotModel(OpenAICompatibleModel):
if model_config_dict is None:
model_config_dict = MoonshotConfig().as_dict()
api_key = api_key or os.environ.get("MOONSHOT_API_KEY")
- url = url or os.environ.get(
- "MOONSHOT_API_BASE_URL",
- "https://api.moonshot.cn/v1",
- )
+ url = url or os.environ.get("MOONSHOT_API_BASE_URL")
timeout = timeout or float(os.environ.get("MODEL_TIMEOUT", 180))
super().__init__(
model_type=model_type,