Commit Graph

23 Commits

Author SHA1 Message Date
Yannic Kilcher cc03376d86 added root tokens and endpoint for adding api keys (#742)
* 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>
2023-01-15 21:24:25 +00:00
Andrew Maguire 0f607c7a28 export and auto-commit docs/docs/api/openapi.json as part of test-api-contract workflow (#719)
- 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.
2023-01-14 22:40:33 +00:00
Nil Andreu a902c600fa Store Message Toxicity in database (#553)
* [NEW] MessageToxicity table

* [NEW] Alembic message Toxicity

* [NEW] Model name enum

* [NEW] Refactor Enum HF

* [NEW] Settings: DEBUT_SKIP_TOXICITY_CALCULATION

* [NEW] Store toxicity values

* [FIX] Merge conflict

* [FIX] Documentation

* [NEW] save_toxicity: function

* [FIX] Formatted string

* [NEW] DEBUG_SKIP_TOXICITY_CALCULATION=True

* [FIX] HfClassificationModel

* [FIX] Alembic merge heads

* [NEW] Refactor save_toxicity

* [NEW] Separating score/label

* [NEW] Store score and label

* [FIX] Cleaning Alembic

* [NEW] Clean HF names

* [NEW] Not type hinting

* [NEW] Update alembic versions

* [NEW] Revert the changes

* [NEW] Type hinting label & score

* Updated down_revision in migration script

Co-authored-by: Andreas Köpf <andreas.koepf@xamla.com>
2023-01-14 12:22:55 +00:00
Andreas Köpf 14fa08e2e7 Message tree state machine (#555)
* 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>
2023-01-11 10:54:03 +01:00
jojopirker 11d55d572a message embeddings in Messages table 2023-01-08 12:28:38 +01:00
Gareth Davidson c3c7a1701a run prettier with new params 2023-01-01 20:57:35 +00:00
Jack Michaud 857eaf26b1 ci: add Test API Contract workflow 2023-01-01 13:06:18 -05:00
Jack Michaud 29b08875d4 refactor: move print_openapi_schema into main 2023-01-01 18:58:01 +01:00
Jack Michaud 604ad2f8e7 style: run pre-commit hooks 2023-01-01 18:58:01 +01:00
Jack Michaud 953d243a6f chore: start-mock-server waits for health 2023-01-01 18:58:01 +01:00
Jack Michaud 036c4b6c6c test: add contract test for discord bot 2023-01-01 18:58:01 +01:00
Jack Michaud 5c9b9e3c9f fix: use prism instead of wiremock
the previous iteration of this script which used wiremock threw a null pointer exception.
2023-01-01 18:58:01 +01:00
Jack Michaud b5ebab8839 chore: add print_openapi_schema and start-mock-server.sh script 2023-01-01 18:58:01 +01:00
Andreas Köpf 71eb09b28a adapt backend-development/run-local.sh 2022-12-29 15:58:35 +01:00
Andreas Köpf fb516e91fc add backend-dev start-docker script for convenience 2022-12-29 00:58:52 +01:00
Yannic Kilcher 0ee3196064 added sleep instead of true containers in compose 2022-12-29 00:38:12 +01:00
croumegous 64206895ff Unified multiple Docker Compose files into one for easier usage 2022-12-28 13:26:30 +01:00
Yannic Kilcher 5125e84055 created debug credentials provider 2022-12-26 16:13:43 +01:00
Yannic Kilcher 21f44d2d4c removed ALLOW_ANY_API_KEY and allow skipping API key check in debug 2022-12-25 17:25:30 +01:00
Yannic Kilcher ce92f184c5 used more extend configs for compose files 2022-12-24 20:46:03 +01:00
Yannic Kilcher 2c997b993d adjusted readme 2022-12-19 19:13:48 +01:00
Yannic Kilcher b34ef75423 started re-working python code 2022-12-19 18:00:09 +01:00
Yannic Kilcher 0d9034e4bb changed scripts location 2022-12-17 22:31:21 +01:00