Skip to content

Commit

Permalink
resoving issues and fix overwritten readme
Browse files Browse the repository at this point in the history
  • Loading branch information
garyzhang99 committed May 6, 2024
1 parent 83bedfe commit a757b1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion src/agentscope/models/zhipu_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`):
Expand All @@ -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`.
Expand All @@ -57,7 +64,7 @@ def __init__(

self.client = zhipuai.ZhipuAI(
api_key=api_key,
**kwargs,
**(client_args or {}),
)

self._register_default_metrics()
Expand Down

0 comments on commit a757b1f

Please sign in to comment.