diff --git a/README.md b/README.md index ef89378ee..df32f2ac1 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,7 @@ the following libraries. - [Self-Organizing Conversation](./examples/conversation_self_organizing) - [Basic Conversation with LangChain library](./examples/conversation_with_langchain) - [Conversation with ReAct Agent](./examples/conversation_with_react_agent) + - [Conversation in Natural Language to Query SQL](./examples/conversation_nl2sql/) - [Conversation with RAG Agent](./examples/conversation_with_RAG_agents) - Game diff --git a/src/agentscope/models/zhipu_model.py b/src/agentscope/models/zhipu_model.py index 97e4270ad..9e7214f59 100644 --- a/src/agentscope/models/zhipu_model.py +++ b/src/agentscope/models/zhipu_model.py @@ -23,10 +23,15 @@ def __init__( config_name: str, model_name: str = None, api_key: str = None, + client_args: dict = None, generate_args: dict = None, **kwargs: Any, ) -> None: """Initialize the zhipuai client. + To init the ZhipuAi client, the api_key is required. + Other client args include base_url and timeout. + The base_url is set to https://open.bigmodel.cn/api/paas/v4 + if not specified. The timeout arg is set for http request timeout. Args: config_name (`str`): @@ -36,6 +41,8 @@ def __init__( api_key (`str`, default `None`): The API key for ZhipuAI API. If not specified, it will be read from the environment variable. + client_args (`dict`, default `None`): + The extra keyword arguments to initialize the OpenAI client. generate_args (`dict`, default `None`): The extra keyword arguments used in zhipuai api generation, e.g. `temperature`, `seed`. @@ -57,7 +64,7 @@ def __init__( self.client = zhipuai.ZhipuAI( api_key=api_key, - **kwargs, + **(client_args or {}), ) self._register_default_metrics()