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

camel-docs-bot0cff2f079d7b
diff --git a/docs/mintlify/docs.json b/docs/mintlify/docs.json
index af0ac098d..622d43cc4 100644
--- a/docs/mintlify/docs.json
+++ b/docs/mintlify/docs.json
@@ -219,6 +219,7 @@
"reference/camel.configs.openai_config",
"reference/camel.configs.openrouter_config",
"reference/camel.configs.ppio_config",
+ "reference/camel.configs.qianfan_config",
"reference/camel.configs.qwen_config",
"reference/camel.configs.reka_config",
"reference/camel.configs.samba_config",
@@ -304,6 +305,7 @@
"reference/camel.models.openai_model",
"reference/camel.models.openrouter_model",
"reference/camel.models.ppio_model",
+ "reference/camel.models.qianfan_model",
"reference/camel.models.qwen_model",
"reference/camel.models.reka_model",
"reference/camel.models.samba_model",
diff --git a/docs/mintlify/key_modules/models.mdx b/docs/mintlify/key_modules/models.mdx
index 859886e49..3c65ada17 100644
--- a/docs/mintlify/key_modules/models.mdx
+++ b/docs/mintlify/key_modules/models.mdx
@@ -45,6 +45,8 @@ CAMEL supports a wide range of models, including [OpenAI’s GPT series](https:/
| **AWS Bedrock** | [supported models](https://us-west-2.console.aws.amazon.com/bedrock/home?region=us-west-2#/) |
| **IBM WatsonX** | [supported models](https://jp-tok.dataplatform.cloud.ibm.com/samples?context=wx&tab=foundation-model) |
| **Crynux** | [supported models](https://docs.crynux.ai/application-development/how-to-run-llm-using-crynux-network/supported-models) |
+| **qianfan** | [supported models](https://cloud.baidu.com/doc/QIANFANWORKSHOP/s/Wm9cvy6rl) |
+
## 3. How to Use Models via API Calls
diff --git a/docs/mintlify/reference/camel.configs.qianfan_config.mdx b/docs/mintlify/reference/camel.configs.qianfan_config.mdx
new file mode 100644
index 000000000..09552895a
--- /dev/null
+++ b/docs/mintlify/reference/camel.configs.qianfan_config.mdx
@@ -0,0 +1,30 @@
+<a id="camel.configs.qianfan_config"></a>
+
+<a id="camel.configs.qianfan_config.QianfanConfig"></a>
+
+## QianfanConfig
+
+```python
+class QianfanConfig(BaseConfig):
+```
+
+Defines the parameters for generating chat completions using OpenAI
+compatibility.
+
+Reference: https://cloud.baidu.com/doc/qianfan-api/s/3m7of64lb
+
+**Parameters:**
+
+- **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`)
+- **repetition_penalty** (float, optional): Penalizes new tokens based on their appearance in the prompt and generated text. (default: :obj:`None`)
+- **stream** (bool, optional): Whether to stream the response. (default: :obj:`None`)
+- **temperature** (float, optional): Controls randomness in the response. Higher values make output more random, lower values make it more deterministic. Range: [0.0, 2.0]. (default: :obj:`None`)
+- **top_p** (float, optional): Controls diversity via nucleus sampling.
+- **Range**: [0.0, 1.0]. (default: :obj:`None`)
+- **logit_bias** (dict, optional): Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from :obj:`-100` to :obj:`100`. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between:obj:` -1`
+- **and**: obj:`1` should decrease or increase likelihood of selection; values like :obj:`-100` or :obj:`100` should result in a ban or exclusive selection of the relevant token. (default: :obj:`None`)
+- **max_tokens** (Union[int, NotGiven], optional): Maximum number of tokens to generate. If not provided, model will use its default maximum. (default: :obj:`None`)
+- **stop** (Optional[List[str]], optional): List of stop sequences. (default: :obj:`None`)
+- **n** (Optional[int], optional): Number of chat completion choices to generate for each input message. (default: :obj:`None`)
+- **tools** (List, optional): Specifies an array of tools that the model can call. It can contain one or more tool objects. During a function call process, the model will select one tool from the array. (default: :obj:`None`)
diff --git a/docs/mintlify/reference/camel.models.qianfan_model.mdx b/docs/mintlify/reference/camel.models.qianfan_model.mdx
new file mode 100644
index 000000000..fa63e6213
--- /dev/null
+++ b/docs/mintlify/reference/camel.models.qianfan_model.mdx
@@ -0,0 +1,45 @@
+<a id="camel.models.qianfan_model"></a>
+
+<a id="camel.models.qianfan_model.QianfanModel"></a>
+
+## QianfanModel
+
+```python
+class QianfanModel(OpenAICompatibleModel):
+```
+
+Constructor for Qianfan backend with OpenAI compatibility.
+
+**Parameters:**
+
+- **model_type** (Union[ModelType, str]): Model for which a backend is created, supported model can be found here:
+- **https**: //cloud.baidu.com/doc/QIANFANWORKSHOP/s/Wm9cvy6rl
+- **model_config_dict** (Optional[Dict[str, Any]], optional): A dictionary that will be fed into:obj:`openai.ChatCompletion.create()`. If :obj:`None`, :obj:`QianfanConfig().as_dict()` will be used. (default: :obj:`None`)
+- **api_key** (Optional[str], optional): The API key for authenticating with the Qianfan service. (default: :obj:`None`)
+- **url** (Optional[str], optional): The url to the Qianfan service. If not provided, "https://qianfan.baidubce.com/v2/chat/completions" will be used.(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.
+- **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`)
+
+<a id="camel.models.qianfan_model.QianfanModel.__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
+):
+```
+
+<a id="camel.models.qianfan_model.QianfanModel.check_model_config"></a>
+
+### check_model_config
+
+```python
+def check_model_config(self):
+```
diff --git a/docs/mintlify/reference/camel.types.enums.mdx b/docs/mintlify/reference/camel.types.enums.mdx
index aa423e658..d4cb0a5e9 100644
--- a/docs/mintlify/reference/camel.types.enums.mdx
+++ b/docs/mintlify/reference/camel.types.enums.mdx
@@ -309,6 +309,14 @@ def is_siliconflow(self):
def is_watsonx(self):
```
+<a id="camel.types.enums.ModelType.is_qianfan"></a>
+
+### is_qianfan
+
+```python
+def is_qianfan(self):
+```
+
<a id="camel.types.enums.ModelType.is_novita"></a>
### is_novita
diff --git a/docs/mintlify/reference/camel.types.unified_model_type.mdx b/docs/mintlify/reference/camel.types.unified_model_type.mdx
index e70a5933c..eaf26b303 100644
--- a/docs/mintlify/reference/camel.types.unified_model_type.mdx
+++ b/docs/mintlify/reference/camel.types.unified_model_type.mdx
@@ -263,6 +263,16 @@ def is_watsonx(self):
Returns whether the model is a WatsonX served model.
+<a id="camel.types.unified_model_type.UnifiedModelType.is_qianfan"></a>
+
+### is_qianfan
+
+```python
+def is_qianfan(self):
+```
+
+Returns whether the model is a Qianfan served model.
+
<a id="camel.types.unified_model_type.UnifiedModelType.is_crynux"></a>
### is_crynux