diff --git a/docs/sphinx_doc/en/source/tutorial/203-model.md b/docs/sphinx_doc/en/source/tutorial/203-model.md index 2aad86e1e..b3e83d6bf 100644 --- a/docs/sphinx_doc/en/source/tutorial/203-model.md +++ b/docs/sphinx_doc/en/source/tutorial/203-model.md @@ -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. @@ -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", diff --git a/docs/sphinx_doc/zh_CN/source/tutorial/203-model.md b/docs/sphinx_doc/zh_CN/source/tutorial/203-model.md index dda8afe22..33f1d3bd6 100644 --- a/docs/sphinx_doc/zh_CN/source/tutorial/203-model.md +++ b/docs/sphinx_doc/zh_CN/source/tutorial/203-model.md @@ -586,6 +586,7 @@ AgentScope允许开发者自定义自己的模型包装器。新的模型包装 - 继承自`ModelWrapperBase`类, - 提供`model_type`字段以在模型配置中标识这个Model Wrapper类,并 - 实现`__init__`和`__call__`函数。 +- 调用`agentscope.register_model_wrapper_class`函数,将其注册到AgentScope中。 ```python from agentscope.models import ModelWrapperBase @@ -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",