Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor monitor #13

Merged
merged 26 commits into from
Jan 22, 2024
Merged

Conversation

pan-x-c
Copy link
Collaborator

@pan-x-c pan-x-c commented Jan 18, 2024


name: Refactor Monitor

Description

  1. add SqliteMonitor based on sqlite3, and remove DictMonitor
  2. use triggers in sqlite3 to implement quota exceed alarm mechanism
  3. use triggers in sqlite3 to automatically calculate the total cost
  4. support users to directly specify the total cost of a specific model
  5. add sqlite db file to _FileManager
  6. init monitor in _init.py
  7. add tests for SqliteMonitor

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has passed all tests
  • Docstrings have been added/updated in Google Style
  • Documentation has been updated
  • Code is ready for review

@pan-x-c pan-x-c self-assigned this Jan 18, 2024
@pan-x-c pan-x-c added the enhancement New feature or request label Jan 18, 2024
@pan-x-c pan-x-c requested review from DavdGao and qbc2016 January 18, 2024 11:16
@pan-x-c pan-x-c changed the title [WIP] refactor monitor refactor monitor Jan 18, 2024
Copy link
Collaborator

@DavdGao DavdGao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see inline comments. Besides, I can't find the computation for OpenAI cost. For example, cost={prompt_token}*0.001 + {completion_token}*0.002

src/agentscope/_init.py Outdated Show resolved Hide resolved
src/agentscope/configs/model_config.py Show resolved Hide resolved
src/agentscope/file_manager.py Outdated Show resolved Hide resolved
src/agentscope/models/openai_model.py Outdated Show resolved Hide resolved
tests/monitor_test.py Outdated Show resolved Hide resolved
src/agentscope/utils/monitor.py Outdated Show resolved Hide resolved
src/agentscope/utils/monitor.py Show resolved Hide resolved
Copy link
Collaborator

@DavdGao DavdGao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see inline comments, others look good to me.

src/agentscope/utils/monitor.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@DavdGao DavdGao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DavdGao DavdGao merged commit ce00d18 into modelscope:main Jan 22, 2024
5 checks passed
rayrayraykk pushed a commit that referenced this pull request Feb 26, 2024
Limit the chat history to avoid performance loss of UI & fix robust issue
FredericW pushed a commit to FredericW/agentscope that referenced this pull request May 16, 2024
zhijianma pushed a commit to zhijianma/agentscope that referenced this pull request Sep 3, 2024
Added:

Gallery & logout interface
Game Monkey Adventures
Chinese example
rabZhang pushed a commit to rabZhang/agentscope that referenced this pull request Sep 3, 2024
Added:

Gallery & logout interface
Game Monkey Adventures
Chinese example
rabZhang pushed a commit to rabZhang/agentscope that referenced this pull request Sep 3, 2024
Added:

Gallery & logout interface
Game Monkey Adventures
Chinese example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants