Skip to content

Commit

Permalink
fix docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-x-c committed Jan 18, 2024
1 parent f4ad469 commit ec1f2f8
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/agentscope/utils/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.
"""
Expand Down

0 comments on commit ec1f2f8

Please sign in to comment.