* move task logic to task handlers
* rename command
* remove test code
* rename classes and add missing handler creations
* switch task back to random and fetch log_channel_id from db
* add tos_acceptance_date column to user
* send 451 UNAVAILABLE_FOR_LEGAL_REASONS status
* add create user REST endpoint
* adapt text-frontend to ToS requirements
* set DEBUG_IGNORE_TOS_ACCEPTANCE default to True (temporary change)
* update down revision to f60958968ff8
* add full message to prompt-labeling & always require full prompt labeling
* always sending conversation, also for initial prompt labeling
* update type annotation
* fix: update user streaks
* Moved streak_last_day_date & streak_days from UserStats to User
* Updated Alembic version
* update last_activity after tm.handle_interaction()
* periodically executed function in main.py to update the user_streak every 4hrs
* fix:removed log messages
* fix: pre commit issues
* refactor: incorporated review comments
* fix: removed the managed -scope.
* refactor: managed_tx to Outer REST Db Ops in /interaction API
* fix: pre-commit changes
* fix: added streak and last_activity_date to protocol.FrontEndUser
* fix: pre-commit fixes after merge
* fix: added streak info to user_stat_repository, leaderboard and review comments
* fix: proper 4h delay and simpler startup_time initialisation
---------
Co-authored-by: James Melvin <melvin@gameface.ai>
* added changes for user specific message dumplication filter, added error codes, and settings variable as described in Draft PR #926, ran precommit
* removed debug statements
* add missing await to async_managed_tx_method
* add 2nd missing await to async_managed_tx_method
* added changes for user specific message dumplication filter, added error codes, and settings variable as described in Draft PR #926, ran precommit
* removed debug statements
* assert task user matches prompt_repository user
* removed assert statments
* moved duplicate_message_filter and message_length check into store_text_reply
* removed old checks in tree_manager
* add LabelDescription list to labeling tasks
* make +1 & -1 emoji exclusive (only one of both or none)
* add red_flag emoji to message when reported
* fix task's valid labels
* fix typo
* add disposition to text labeling tasks
* add emoji stats to ConversationMessage
* add user emoji augmentation for message queries
* add auth_method,username to message queries (query emoji status)
* add auth_method+username for single message
* fix param name typo
* only join rows when message.emojis != JSON.NULL
* formatting
* make sure emojis and user_emojis default to {}, []
* remove init_user(), use fresh empty default collections
* very primitive implementation of inference
* re-worked with security in mind
* removed polling from clients
* switched workers to websockets
* implemented back and forth chats
* 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
* add query_incomplete_rankings()
* Add SQL queries for TreeManager task selection
* first working version of TreeManager.next_task()
* remove old generate_task(), add mandatory_labels to text_labels task
* Add ConversationMessage list to Ranking tasks
* add more sophisticated sql queries to find extendible trees
* add TreeManager.query_extendible_parents()
* fix task validation, seed data insertion (reviewed)
* provide user for task selection in text-frontend
* enter 'growing' state
* enter 'aborted_low_grade' state
* enter 'ranking' state
* check tree 'growing' state upon relpy insertion
* exclude user from labeling their own messages (added DEBUG_ALLOW_SELF_LABELING setting)
* add DEBUG_ALLOW_SELF_LABELING to docker-compose.yaml
* fix ranking submission
* add query_tree_ranking_results()
* add ranked_message_ids to RankingReactionPayload
* fix reply_messages instead of prompt_messages
* incorment 'ranking_count' of ranked replies
* added logic to check_condition_for_scoring_state
* changes to msg_tree_state_machine
* pre-commit changes
* enter 'ready_for_scoring' state
* re-add HF embedding call (lost during merge)
* use prepare_conversation() helper for seed-data creation
* Partially add user specified task selection
Co-authored-by: Daniel Hug <danielpatrickhug@gmail.com>
* Add endpoint to resolve frontend user by auth method and username
* Require client ID for frontend user lookup
* Remove unnecessary if check
* Fix PromptRepository -> UserRepository
* Convert to protocol User
* Move User prep
* Address review comments
* 404 -> HTTP_404_NOT_FOUND