From ec1f2f8bdd356e46e4cd66a274ee2bc4c4aa027f Mon Sep 17 00:00:00 2001 From: "panxuchen.pxc" Date: Thu, 18 Jan 2024 19:33:34 +0800 Subject: [PATCH] fix docstring --- src/agentscope/utils/monitor.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/agentscope/utils/monitor.py b/src/agentscope/utils/monitor.py index 1f6a68429..9e95e8b45 100644 --- a/src/agentscope/utils/monitor.py +++ b/src/agentscope/utils/monitor.py @@ -200,8 +200,8 @@ def register_budget( model_name (`str`): model that requires budget. value (`float`): the budget value. prefix (`Optional[str]`, default `None`): used to distinguish - multiple budget registrations. For multiple registrations with - the same `prefix`, only the first time will take effect. + multiple budget registrations. For multiple registrations with + the same `prefix`, only the first time will take effect. Returns: `bool`: whether the operation success. @@ -436,6 +436,15 @@ def __init__( table_name: str = _DEFAULT_MONITOR_TABLE_NAME, drop_exists: bool = False, ) -> None: + """Initialize a SqliteMonitor. + + Args: + db_path (`str`): path to the sqlite db file. + table_name (`str`, optional): the table name used by the monitor. + Defaults to _DEFAULT_MONITOR_TABLE_NAME. + drop_exists (bool, optional): whether to delete the original table + when the table already exists. Defaults to False. + """ super().__init__() self.db_path = db_path self.table_name = table_name @@ -722,6 +731,7 @@ def get_pricing() -> dict: Returns: `dict`: the dict with pricing information. """ + # TODO: get pricing from files return { "gpt-4-turbo": { "prompt_tokens": 0.00001, @@ -761,6 +771,11 @@ def get_monitor( ) -> MonitorBase: """Get the monitor instance. + Args: + impl_type (`Optional[str]`, optional): the type of monitor, + currently supports `sqlite` and `dict`, the default is + `sqlite`. + Returns: `MonitorBase`: the monitor instance. """