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-bot12202a7dd4a2
diff --git a/docs/mintlify/reference/camel.models.azure_openai_model.mdx b/docs/mintlify/reference/camel.models.azure_openai_model.mdx
index d8ce07d37..a904aef46 100644
--- a/docs/mintlify/reference/camel.models.azure_openai_model.mdx
+++ b/docs/mintlify/reference/camel.models.azure_openai_model.mdx
@@ -22,7 +22,9 @@ Azure OpenAI API in a unified BaseModelBackend interface.
- **azure_ad_token_provider** (Optional[AzureADTokenProvider], optional): A function that returns an Azure Active Directory token, will be invoked on every request. (default: :obj:`None`)
- **token_counter** (Optional[BaseTokenCounter], optional): Token counter to use for the model. If not provided, :obj:`OpenAITokenCounter` 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.
+- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`)
+- **client** (Optional[Any], optional): A custom synchronous AzureOpenAI client instance. If provided, this client will be used instead of creating a new one. Useful for RL frameworks like AReaL or rLLM that provide Azure OpenAI-compatible clients. The client should implement the AzureOpenAI client interface with `.chat.completions.create()` and `.beta.chat.completions.parse()` methods. (default: :obj:`None`)
+- **async_client** (Optional[Any], optional): A custom asynchronous AzureOpenAI client instance. If provided, this client will be used instead of creating a new one. The client should implement the AsyncAzureOpenAI client interface. (default: :obj:`None`) **kwargs (Any): Additional arguments to pass to the client initialization. Ignored if custom clients are provided.
- **References**:
- **https**: //learn.microsoft.com/en-us/azure/ai-services/openai/
@@ -44,6 +46,8 @@ def __init__(
azure_ad_token_provider: Optional['AzureADTokenProvider'] = None,
azure_ad_token: Optional[str] = None,
max_retries: int = 3,
+ client: Optional[Any] = None,
+ async_client: Optional[Any] = None,
**kwargs: Any
):
```
diff --git a/docs/mintlify/reference/camel.models.model_factory.mdx b/docs/mintlify/reference/camel.models.model_factory.mdx
index 2fdcb8a15..e59bccfb8 100644
--- a/docs/mintlify/reference/camel.models.model_factory.mdx
+++ b/docs/mintlify/reference/camel.models.model_factory.mdx
@@ -22,6 +22,8 @@ def create(
url: Optional[str] = None,
timeout: Optional[float] = None,
max_retries: int = 3,
+ client: Optional[Any] = None,
+ async_client: Optional[Any] = None,
**kwargs
):
```
@@ -37,7 +39,9 @@ Creates an instance of `BaseModelBackend` of the specified type.
- **api_key** (Optional[str], optional): The API key for authenticating with the model service. (default: :obj:`None`)
- **url** (Optional[str], optional): The url to the model service. (default: :obj:`None`)
- **timeout** (Optional[float], optional): The timeout value in seconds for API calls. (default: :obj:`None`)
-- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`) **kwargs: Additional model-specific parameters that will be passed to the model constructor. For example, Azure OpenAI models may require `api_version`, `azure_deployment_name`, `azure_ad_token_provider`, and `azure_ad_token`.
+- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`)
+- **client** (Optional[Any], optional): A custom synchronous client instance. Supported by models that use OpenAI-compatible APIs . The client should implement the appropriate client interface for the platform. (default: :obj:`None`)
+- **async_client** (Optional[Any], optional): A custom asynchronous client instance. Supported by models that use OpenAI-compatible APIs. The client should implement the appropriate async client interface for the platform. (default: :obj:`None`) **kwargs: Additional model-specific parameters that will be passed to the model constructor. For example, Azure OpenAI models may require `api_version`, `azure_deployment_name`, `azure_ad_token_provider`, and `azure_ad_token`.
**Returns:**
diff --git a/docs/mintlify/reference/camel.models.openai_compatible_model.mdx b/docs/mintlify/reference/camel.models.openai_compatible_model.mdx
index 78da6535f..6d54f2920 100644
--- a/docs/mintlify/reference/camel.models.openai_compatible_model.mdx
+++ b/docs/mintlify/reference/camel.models.openai_compatible_model.mdx
@@ -18,7 +18,9 @@ Constructor for model backend supporting OpenAI compatibility.
- **url** (str): The url to the model service.
- **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 OpenAI client initialization. These can include parameters like 'organization', 'default_headers', 'http_client', etc.
+- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`)
+- **client** (Optional[Any], optional): A custom synchronous OpenAI-compatible client instance. If provided, this client will be used instead of creating a new one. Useful for RL frameworks like AReaL or rLLM that provide OpenAI-compatible clients (e.g., ArealOpenAI). The client should implement the OpenAI client interface with `.chat.completions.create()` and `.beta.chat. completions.parse()` methods. (default: :obj:`None`)
+- **async_client** (Optional[Any], optional): A custom asynchronous OpenAI-compatible client instance. If provided, this client will be used instead of creating a new one. The client should implement the AsyncOpenAI client interface. (default: :obj:`None`) **kwargs (Any): Additional arguments to pass to the OpenAI client initialization. These can include parameters like 'organization', 'default_headers', 'http_client', etc. Ignored if custom clients are provided.
<a id="camel.models.openai_compatible_model.OpenAICompatibleModel.__init__"></a>
@@ -34,6 +36,8 @@ def __init__(
token_counter: Optional[BaseTokenCounter] = None,
timeout: Optional[float] = None,
max_retries: int = 3,
+ client: Optional[Any] = None,
+ async_client: Optional[Any] = None,
**kwargs: Any
):
```
diff --git a/docs/mintlify/reference/camel.models.openai_model.mdx b/docs/mintlify/reference/camel.models.openai_model.mdx
index ba62e2ae8..b5d0968e0 100644
--- a/docs/mintlify/reference/camel.models.openai_model.mdx
+++ b/docs/mintlify/reference/camel.models.openai_model.mdx
@@ -18,7 +18,9 @@ OpenAI API in a unified BaseModelBackend interface.
- **url** (Optional[str], optional): The url to the OpenAI service. (default: :obj:`None`)
- **token_counter** (Optional[BaseTokenCounter], optional): Token counter to use for the model. If not provided, :obj:`OpenAITokenCounter` 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 OpenAI client initialization. These can include parameters like 'organization', 'default_headers', 'http_client', etc.
+- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`)
+- **client** (Optional[Any], optional): A custom synchronous OpenAI client instance. If provided, this client will be used instead of creating a new one. Useful for RL frameworks like AReaL or rLLM that provide OpenAI-compatible clients. The client should implement the OpenAI client interface with `.chat.completions.create()` and `.beta.chat.completions.parse()` methods. (default: :obj:`None`)
+- **async_client** (Optional[Any], optional): A custom asynchronous OpenAI client instance. If provided, this client will be used instead of creating a new one. The client should implement the AsyncOpenAI client interface. (default: :obj:`None`) **kwargs (Any): Additional arguments to pass to the OpenAI client initialization. These can include parameters like 'organization', 'default_headers', 'http_client', etc. Ignored if custom clients are provided.
<a id="camel.models.openai_model.OpenAIModel.__init__"></a>
@@ -34,6 +36,8 @@ def __init__(
token_counter: Optional[BaseTokenCounter] = None,
timeout: Optional[float] = None,
max_retries: int = 3,
+ client: Optional[Any] = None,
+ async_client: Optional[Any] = None,
**kwargs: Any
):
```
diff --git a/docs/mintlify/reference/camel.models.samba_model.mdx b/docs/mintlify/reference/camel.models.samba_model.mdx
index dd6d15e77..c2941e22b 100644
--- a/docs/mintlify/reference/camel.models.samba_model.mdx
+++ b/docs/mintlify/reference/camel.models.samba_model.mdx
@@ -18,7 +18,9 @@ SambaNova service interface.
- **url** (Optional[str], optional): The url to the SambaNova service. Current support SambaVerse API: :obj:`"https://sambaverse.sambanova.ai/api/predict"` and SambaNova Cloud: :obj:`"https://api.sambanova.ai/v1"` (default: :obj:`https://api. sambanova.ai/v1`)
- **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`)
-- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`) **kwargs (Any): Additional arguments to pass to the client initialization.
+- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`)
+- **client** (Optional[Any], optional): A custom synchronous OpenAI-compatible client instance. If provided, this client will be used instead of creating a new one. Only applicable when using SambaNova Cloud API. (default: :obj:`None`)
+- **async_client** (Optional[Any], optional): A custom asynchronous OpenAI-compatible client instance. If provided, this client will be used instead of creating a new one. Only applicable when using SambaNova Cloud API. (default: :obj:`None`) **kwargs (Any): Additional arguments to pass to the client initialization. Ignored if custom clients are provided.
<a id="camel.models.samba_model.SambaModel.__init__"></a>
@@ -34,6 +36,8 @@ def __init__(
token_counter: Optional[BaseTokenCounter] = None,
timeout: Optional[float] = None,
max_retries: int = 3,
+ client: Optional[Any] = None,
+ async_client: Optional[Any] = None,
**kwargs: Any
):
```
diff --git a/docs/mintlify/reference/camel.models.sglang_model.mdx b/docs/mintlify/reference/camel.models.sglang_model.mdx
index 183863ed8..14cd0e6ed 100644
--- a/docs/mintlify/reference/camel.models.sglang_model.mdx
+++ b/docs/mintlify/reference/camel.models.sglang_model.mdx
@@ -18,7 +18,9 @@ SGLang service interface.
- **url** (Optional[str], optional): The url to the model service. If not provided, :obj:`"http://127.0.0.1:30000/v1"` 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. (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.
+- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`)
+- **client** (Optional[Any], optional): A custom synchronous OpenAI-compatible client instance. If provided, this client will be used instead of creating a new one. Note: When using custom clients with SGLang, server auto-start features will be disabled. (default: :obj:`None`)
+- **async_client** (Optional[Any], optional): A custom asynchronous OpenAI-compatible client instance. If provided, this client will be used instead of creating a new one. (default: :obj:`None`) **kwargs (Any): Additional arguments to pass to the client initialization. Ignored if custom clients are provided.
- **Reference**: https://sgl-project.github.io/backend/openai_api_completions. html
<a id="camel.models.sglang_model.SGLangModel.__init__"></a>
@@ -35,6 +37,8 @@ def __init__(
token_counter: Optional[BaseTokenCounter] = None,
timeout: Optional[float] = None,
max_retries: int = 3,
+ client: Optional[Any] = None,
+ async_client: Optional[Any] = None,
**kwargs: Any
):
```