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

Auto-update documentation after merge [skip ci]

camel-docs-botd455652ccf5e
diff --git a/docs/key_modules/models.md b/docs/key_modules/models.md
index 606e8f1bf..83ed5656d 100644
--- a/docs/key_modules/models.md
+++ b/docs/key_modules/models.md
@@ -45,6 +45,7 @@ CAMEL supports a wide range of models, including [OpenAI’s GPT series](https:/
| **Lingyiwanwu** | yi-lightning, yi-large, yi-medium<br/>yi-large-turbo, yi-vision, yi-medium-200k<br/>yi-spark, yi-large-rag, yi-large-fc |
| **Qwen** | qwen3-coder-plus,qwq-32b-preview, qwen-max, qwen-plus, qwen-turbo, qwen-long<br/>qwen-vl-max, qwen-vl-plus, qwen-math-plus, qwen-math-turbo, qwen-coder-turbo<br/>qwen2.5-coder-32b-instruct, qwen2.5-72b-instruct, qwen2.5-32b-instruct, qwen2.5-14b-instruct |
| **DeepSeek** | deepseek-chat<br/>deepseek-reasoner |
+| **CometAPI** | **All models available on [CometAPI](https://api.cometapi.com/pricing)**<br/>Including: gpt-5-chat-latest, gpt-5, gpt-5-mini, gpt-5-nano<br/>claude-opus-4-1-20250805, claude-sonnet-4-20250514, claude-3-7-sonnet-latest<br/>gemini-2.5-pro, gemini-2.5-flash, grok-4-0709, grok-3<br/>deepseek-v3.1, deepseek-v3, deepseek-r1-0528, qwen3-30b-a3b |
| **Nebius** | **All models available on [Nebius AI Studio](https://studio.nebius.com/)**<br/>Including: gpt-oss-120b, gpt-oss-20b, GLM-4.5<br/>DeepSeek V3 & R1, LLaMA, Mistral, and more |
| **ZhipuAI** | glm-4, glm-4v, glm-4v-flash<br/>glm-4v-plus-0111, glm-4-plus, glm-4-air<br/>glm-4-air-0111, glm-4-airx, glm-4-long<br/>glm-4-flashx, glm-zero-preview, glm-4-flash, glm-3-turbo |
| **InternLM** | internlm3-latest, internlm3-8b-instruct<br/>internlm2.5-latest, internlm2-pro-chat |
@@ -195,6 +196,80 @@ Integrate your favorite models into CAMEL-AI with straightforward Python calls.
</Tab>
+ <Tab title="CometAPI">
+
+ Leverage [CometAPI](https://api.cometapi.com/)'s unified access to multiple frontier AI models:
+
+ - **CometAPI Platform** ([CometAPI](https://www.cometapi.com/?utm_source=camel-ai&utm_campaign=integration&utm_medium=integration&utm_content=integration)):
+ - **API Key Setup**: Obtain your CometAPI key to start integration.
+ - **OpenAI Compatible**: Use familiar OpenAI API patterns with advanced frontier models.
+
+ ```python
+ from camel.models import ModelFactory
+ from camel.types import ModelPlatformType, ModelType
+ from camel.configs import CometAPIConfig
+ from camel.agents import ChatAgent
+
+ model = ModelFactory.create(
+ model_platform=ModelPlatformType.COMETAPI,
+ model_type=ModelType.COMETAPI_GPT_5_CHAT_LATEST,
+ model_config_dict=CometAPIConfig(temperature=0.2).as_dict(),
+ )
+
+ agent = ChatAgent(
+ system_message="You are a helpful assistant.",
+ model=model
+ )
+
+ response = agent.step("Say hi to CAMEL AI community.")
+ print(response.msgs[0].content)
+ ```
+
+ <Note type="info">
+ **Flexible Model Access:** You can use any model available on CometAPI by passing the model name as a string to `model_type`, even if it's not in the predefined enums.
+ </Note>
+
+ **Environment Variables:**
+ ```bash
+ export COMETAPI_KEY="your_cometapi_key_here"
+ export COMETAPI_API_BASE_URL="https://api.cometapi.com/v1/" # Optional
+ ```
+
+ **Model Support:**
+ - **Complete Access:** All models available on [CometAPI](https://api.cometapi.com/) are supported
+ - **Predefined Enums:** Common models like `COMETAPI_GPT_5_CHAT_LATEST`, `COMETAPI_CLAUDE_OPUS_4_1_20250805`, etc.
+ - **String-based Access:** Use any model name directly as a string for maximum flexibility
+
+ **Example with different models:**
+ ```python
+ # Access multiple frontier models through CometAPI
+ models_to_try = [
+ ModelType.COMETAPI_GPT_5_CHAT_LATEST,
+ ModelType.COMETAPI_GPT_5,
+ ModelType.COMETAPI_GPT_5_MINI,
+ ModelType.COMETAPI_CLAUDE_OPUS_4_1_20250805,
+ ModelType.COMETAPI_CLAUDE_SONNET_4_20250514,
+ ModelType.COMETAPI_CLAUDE_3_7_SONNET_LATEST,
+ ModelType.COMETAPI_GEMINI_2_5_PRO,
+ ModelType.COMETAPI_GEMINI_2_5_FLASH,
+ ModelType.COMETAPI_GROK_4_0709,
+ ModelType.COMETAPI_GROK_3,
+ ModelType.COMETAPI_DEEPSEEK_V3_1,
+ ModelType.COMETAPI_DEEPSEEK_V3,
+ ModelType.COMETAPI_QWEN3_30B_A3B,
+ ModelType.COMETAPI_QWEN3_CODER_PLUS_2025_07_22
+ ]
+
+ for model_type in models_to_try:
+ model = ModelFactory.create(
+ model_platform=ModelPlatformType.COMETAPI,
+ model_type=model_type
+ )
+ # Use the model...
+ ```
+
+ </Tab>
+
<Tab title="Nebius">
Leverage [Nebius AI Studio](https://nebius.com/)'s high-performance GPU cloud with OpenAI-compatible models:
diff --git a/docs/mintlify/docs.json b/docs/mintlify/docs.json
index c65e4102c..2633059a5 100644
--- a/docs/mintlify/docs.json
+++ b/docs/mintlify/docs.json
@@ -224,6 +224,7 @@
"reference/camel.configs.base_config",
"reference/camel.configs.bedrock_config",
"reference/camel.configs.cohere_config",
+ "reference/camel.configs.cometapi_config",
"reference/camel.configs.crynux_config",
"reference/camel.configs.deepseek_config",
"reference/camel.configs.gemini_config",
@@ -306,6 +307,7 @@
"reference/camel.models.base_audio_model",
"reference/camel.models.base_model",
"reference/camel.models.cohere_model",
+ "reference/camel.models.cometapi_model",
"reference/camel.models.crynux_model",
"reference/camel.models.deepseek_model",
"reference/camel.models.fish_audio_model",
diff --git a/docs/mintlify/reference/camel.configs.cometapi_config.mdx b/docs/mintlify/reference/camel.configs.cometapi_config.mdx
new file mode 100644
index 000000000..abdf999e1
--- /dev/null
+++ b/docs/mintlify/reference/camel.configs.cometapi_config.mdx
@@ -0,0 +1,29 @@
+<a id="camel.configs.cometapi_config"></a>
+
+<a id="camel.configs.cometapi_config.CometAPIConfig"></a>
+
+## CometAPIConfig
+
+```python
+class CometAPIConfig(BaseConfig):
+```
+
+Defines the parameters for generating chat completions using CometAPI's
+OpenAI-compatible interface.
+
+Reference: https://api.cometapi.com/v1/
+
+**Parameters:**
+
+- **temperature** (float, optional): Sampling temperature to use, between :obj:`0` and :obj:`2`. Higher values make the output more random, while lower values make it more focused and deterministic. (default: :obj:`None`)
+- **top_p** (float, optional): An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So :obj:`0.1` means only the tokens comprising the top 10% probability mass are considered. (default: :obj:`None`)
+- **n** (int, optional): How many chat completion choices to generate for each input message. (default: :obj:`None`)
+- **response_format** (object, optional): An object specifying the format that the model must output. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106. Setting to `{"type": "json_object"}` enables JSON mode, which guarantees the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.
+- **stream** (bool, optional): If True, partial message deltas will be sent as data-only server-sent events as they become available. (default: :obj:`None`)
+- **stop** (str or list, optional): Up to :obj:`4` sequences where the API will stop generating further tokens. (default: :obj:`None`)
+- **max_tokens** (int, optional): The maximum number of tokens to generate in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length. (default: :obj:`None`)
+- **presence_penalty** (float, optional): Number between :obj:`-2.0` and :obj:`2.0`. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. See more information about frequency and presence penalties. (default: :obj:`None`)
+- **frequency_penalty** (float, optional): Number between :obj:`-2.0` and :obj:`2.0`. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. See more information about frequency and presence penalties. (default: :obj:`None`)
+- **user** (str, optional): A unique identifier representing your end-user, which can help CometAPI to monitor and detect abuse. (default: :obj:`None`)
+- **tools** (list[FunctionTool], optional): A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.
+- **tool_choice** (Union[dict[str, str], str], optional): Controls which (if any) tool is called by the model. :obj:`"none"` means the model will not call any tool and instead generates a message. :obj:`"auto"` means the model can pick between generating a message or calling one or more tools. :obj:`"required"` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. :obj:`"none"` is the default when no tools are present. :obj:`"auto"` is the default if tools are present.
diff --git a/docs/mintlify/reference/camel.models.cometapi_model.mdx b/docs/mintlify/reference/camel.models.cometapi_model.mdx
new file mode 100644
index 000000000..425d35ad4
--- /dev/null
+++ b/docs/mintlify/reference/camel.models.cometapi_model.mdx
@@ -0,0 +1,41 @@
+<a id="camel.models.cometapi_model"></a>
+
+<a id="camel.models.cometapi_model.CometAPIModel"></a>
+
+## CometAPIModel
+
+```python
+class CometAPIModel(OpenAICompatibleModel):
+```
+
+LLM API served by CometAPI in a unified OpenAICompatibleModel
+interface.
+
+**Parameters:**
+
+- **model_type** (Union[ModelType, str]): Model for which a backend is created.
+- **model_config_dict** (Optional[Dict[str, Any]], optional): A dictionary that will be fed into:obj:`openai.ChatCompletion.create()`.
+- **If**: obj:`None`, :obj:`CometAPIConfig().as_dict()` will be used. (default: :obj:`None`)
+- **api_key** (Optional[str], optional): The API key for authenticating with the CometAPI service. (default: :obj:`None`).
+- **url** (Optional[str], optional): The url to the CometAPI service. (default: :obj:`None`)
+- **token_counter** (Optional[BaseTokenCounter], optional): Token counter to use for the model. If not provided, :obj:`OpenAITokenCounter( ModelType.GPT_4O_MINI)` will be used. (default: :obj:`None`)
+- **timeout** (Optional[float], optional): The timeout value in seconds for API calls. If not provided, will fall back to the MODEL_TIMEOUT environment variable or default to 180 seconds. (default: :obj:`None`)
+- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`) **kwargs (Any): Additional arguments to pass to the client initialization.
+
+<a id="camel.models.cometapi_model.CometAPIModel.__init__"></a>
+
+### __init__
+
+```python
+def __init__(
+ self,
+ model_type: Union[ModelType, str],
+ model_config_dict: Optional[Dict[str, Any]] = None,
+ api_key: Optional[str] = None,
+ url: Optional[str] = None,
+ token_counter: Optional[BaseTokenCounter] = None,
+ timeout: Optional[float] = None,
+ max_retries: int = 3,
+ **kwargs: Any
+):
+```
diff --git a/docs/mintlify/reference/camel.types.enums.mdx b/docs/mintlify/reference/camel.types.enums.mdx
index 292a1532a..b60c20dd9 100644
--- a/docs/mintlify/reference/camel.types.enums.mdx
+++ b/docs/mintlify/reference/camel.types.enums.mdx
@@ -150,6 +150,16 @@ def is_nebius(self):
Returns whether this type of models is served by Nebius AI
Studio.
+<a id="camel.types.enums.ModelType.is_cometapi"></a>
+
+### is_cometapi
+
+```python
+def is_cometapi(self):
+```
+
+Returns whether this type of models is served by CometAPI.
+
<a id="camel.types.enums.ModelType.is_openrouter"></a>
### is_openrouter
diff --git a/docs/mintlify/reference/camel.types.unified_model_type.mdx b/docs/mintlify/reference/camel.types.unified_model_type.mdx
index 739687a73..4a3979a69 100644
--- a/docs/mintlify/reference/camel.types.unified_model_type.mdx
+++ b/docs/mintlify/reference/camel.types.unified_model_type.mdx
@@ -219,6 +219,16 @@ def is_cohere(self):
Returns whether the model is a Cohere model.
+<a id="camel.types.unified_model_type.UnifiedModelType.is_cometapi"></a>
+
+### is_cometapi
+
+```python
+def is_cometapi(self):
+```
+
+Returns whether the model is a CometAPI served model.
+
<a id="camel.types.unified_model_type.UnifiedModelType.is_yi"></a>
### is_yi