Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DavdGao committed Jan 3, 2025
1 parent 2638dd9 commit 38a411e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions docs/sphinx_doc/en/source/tutorial/203-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ The new model wrapper class should
- inherit from `ModelWrapperBase` class,
- provide a `model_type` field to identify this model wrapper in the model configuration, and
- implement its `__init__` and `__call__` functions.
- register the new model wrapper class by calling `agentscope.register_model_wrapper_class` function

The following is an example for creating a new model wrapper class.

Expand All @@ -586,10 +587,13 @@ class MyModelWrapper(ModelWrapperBase):
# ...
```

After creating the new model wrapper class, the model wrapper will be registered into AgentScope automatically.
You can use it in the model configuration directly.
Then we register the new model wrapper class and use it in the model configuration.

```python
import agentscope

agentscope.register_model_wrapper_class(MyModelWrapper)

my_model_config = {
# Basic parameters
"config_name": "my_model_config",
Expand Down
8 changes: 6 additions & 2 deletions docs/sphinx_doc/zh_CN/source/tutorial/203-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ AgentScope允许开发者自定义自己的模型包装器。新的模型包装
- 继承自`ModelWrapperBase`类,
- 提供`model_type`字段以在模型配置中标识这个Model Wrapper类,并
- 实现`__init__``__call__`函数。
- 调用`agentscope.register_model_wrapper_class`函数,将其注册到AgentScope中。

```python
from agentscope.models import ModelWrapperBase
Expand All @@ -604,10 +605,13 @@ class MyModelWrapper(ModelWrapperBase):
# ...
```

在创建新的模型包装器类之后,模型包装器将自动注册到AgentScope中。
您可以直接在模型配置中使用它。
然后调用`register_model_wrapper_class`函数将其注册到AgentScope中。

```python
import agentscope

agentscope.register_model_wrapper_class(MyModelWrapper)

my_model_config = {
# 基础参数
"config_name": "my_model_config",
Expand Down

0 comments on commit 38a411e

Please sign in to comment.