config
¶
Module
¶
Module(name: str, description: str, version: str, tools: List[Tool], chat_roles: List[type[ChatRole]], react_roles: List[type[ReactRole]], **kwargs)
Bases: BaseModel
A module that can be loaded into SilverLingua.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the module. |
description |
str
|
A description of the module. |
version |
str
|
The version of the module. |
tools |
List[Tool]
|
The tools in the module. |
chat_roles |
List[type[ChatRole]]
|
The chat roles in the module. |
react_roles |
List[type[ReactRole]]
|
The react roles in the module. |
Source code in src/SilverLingua/config.py
check_chat_roles
¶
Source code in src/SilverLingua/config.py
check_react_roles
¶
Source code in src/SilverLingua/config.py
Config
¶
get_chat_role
classmethod
¶
Attempts to get the standardized ChatRole enum from 'role'. If not, returns None.
This is usually used internally for maintaining consistency in Notions across different LLM backends.
Source code in src/SilverLingua/config.py
get_react_role
classmethod
¶
Attempts to get the standardized ReactRole enum from 'role'. If not, returns None.
This is usually used internally for maintaining consistency in Notions across different LLM backends.
Source code in src/SilverLingua/config.py
get_tool
classmethod
¶
Attempts to get the tool with the given name. If not, returns None.
add_chat_role
classmethod
¶
Adds a chat role to the config.
add_react_role
classmethod
¶
Adds a react role to the config.
register_module
classmethod
¶
register_module(module: Module) -> None
Registers a module.