Skip to content

Conversation

PhiRho
Copy link
Collaborator

@PhiRho PhiRho commented Jun 11, 2025

No description provided.

PhiRho added 10 commits June 9, 2025 10:11
- Enhanced the `delete_private_ai_key` function to only delete the database if it exists, preventing unnecessary errors.
- Added error handling for the LiteLLM key deletion to treat 404 responses as successful and log detailed error messages for other exceptions.
- Updated tests to cover scenarios for deleting private AI keys with only vector databases or LLM tokens, including handling service unavailability.
- Introduced a new `monitor_teams` function in `worker.py` to handle daily monitoring tasks for teams, including posting age metrics, sending notifications for approaching expirations, and monitoring key spend.
- Integrated APScheduler in `main.py` to schedule the `monitor_teams` job based on the environment.
- Updated `requirements.txt` to include `apscheduler` as a dependency.
- Enhanced metrics tracking with Prometheus for team freshness and key spend percentage.
- Integrated SESService to send email notifications for teams approaching expiration.
- Added a new email template for expiration notifications.
- Enhanced logging for email sending process, including error handling for missing email addresses and sending failures.
- Implemented `generate_team_admin_token` to create a JWT for team administrators, valid for 2 days.
- Added `generate_team_admin_pricing_url` to construct a URL for the team admin pricing page, including the JWT as a query parameter.
- Enhanced logging for team monitoring to include product presence information.
- Removed the fallback to FAKE_ID for team_id in vector DB limit checks, ensuring limits are only checked with a valid team_id.
- Updated DEFAULT_MAX_SPEND from 20.0 to 27.0 to reflect new pricing structure.
- Introduced multiple tests for the `monitor_teams` function, covering basic metrics, expiration notifications, expired metrics, key spend monitoring, active labels, and error handling.
- Enhanced test coverage for team freshness and key spend metrics, ensuring accurate tracking and notification functionality.
- Utilized mocking for external services to validate behavior without side effects.
- Introduced a new `frontend_route` setting in `config.py` to allow dynamic configuration of the frontend URL.
- Updated the expiration notification email template to enhance messaging and clarity for users.
- Added a new email template for trial extensions, providing users with additional time to explore the service without interruption.
- Refactored the pricing URL generation to utilize the new frontend route setting for better maintainability.
- Updated the `monitor_teams` function to only schedule the monitoring job if limits are enabled, improving control over job execution.
- Changed the metric label from "Age of teams" to "Freshness of teams" for better clarity in tracking team status.
- Refactored the `get_team_keys_by_region` function to be synchronous, enhancing performance by removing unnecessary async overhead.
- Adjusted calculations for team freshness to ensure accurate tracking and logging of team status.
Periodic job for team management
@PhiRho PhiRho merged commit 28d2f11 into main Jun 11, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant