* add admin purge user function
* improve comments
* minor naming changes
* ensuer user is enabled for tasks api requests
* add preview with stats to /admin/purge_user/{id} endpoint
* add update_children_counts()
* only ranking assistant replies by default
* add tasks/availability endpoint allow to specify desired task
* move rank_prompter_replies option to TreeManagerConfiguration
* fix type annotation
* remove desired_task_type from _random_task_selection()
* fix typo
* Convert query_tree_size to sqlachemy, return 'full' text-labeling tasks if they were explicitly requested
* fix: isolation level and nested db.commit() with retry wrappers on concurrent update errors
* refactor: incorporated review comments
changes decorator methods to managed_tx_method and async_managed_tx_method
new enum CommitMode
removed commented commit() from the previous commits
* fix: merge pre-commit errors
* fix: merge pre-commit changes
* fix: conflict in existing OasstErrorCode
* refactor: Added a refresh just to be sure that the select command is triggered on the mapped object
* fix: added refresh for async decorator
Co-authored-by: James Melvin <melvin@gameface.ai>
* added root tokens and endpoint for adding api keys
* Change down revision to current alembic head
* removed added_by_root_token
* refactored description
* fixed jinja errors
Co-authored-by: Andreas Köpf <andreas.koepf@provisio.com>
* add /api/v1/users/{user_id}/stats endpoint
* return 0 stats and add /api/v1/users/{user_id}/stats/{time_frame}
* use utcnow() as modified date for 0 stats
* add leaderboard stats, periodic update via fastapi-utils
* count label tasks for assistant and prompter replies
* Daily stats update every 15 mins, simplify leaderboard endpoint
* add indices for some created_date columns
* make user stats update intervals configurable
* make sure intervals are positive
- copies that openapi.json file to docs/docs/api/openapi.json as part of start-mock-server.sh.
- adds a step to the end of the test-api-contract workflow that just auto-commits changes to the docs/docs/api/openapi.json file.
- excludes docs/docs/api/openapi.json from pre-commit since its already been formatted by jq.
* Add endpoints for getting, updating, deleting users by global user ID
* Resolve formatting
* Include alembic revision script
* Updated down_revision to current alembic head
Co-authored-by: Andreas Köpf <andreas.koepf@xamla.com>