Commit Graph

146 Commits

Author SHA1 Message Date
Jack Michaud 5bb9a397b4 feat: add OasstErrorResponse to protocols
Using a shared protocol to serialize the error in the backend
allows clients to use that same protocol to deserialize it.

Changes to this protocol will be caught in tests.
2023-01-02 19:01:29 -05:00
Yannic Kilcher 2df4e7a735 Merge pull request #295 from croumegous/fastapi-response-model
chore: add fastapi response model to every endpoints, add openapi documentation for API response
2023-01-02 23:17:48 +01:00
croumegous fc7f8cbc1f chore: add fastapi response model to every endpoints, add openapi documentation for API response 2023-01-02 22:55:08 +01:00
yeungadrian 4715a53637 #47- Create API endpoints that return leaderboards (#250)
* Leaderboard endpoints proof of concept
- New leaderboards router
- Two endpoints /api/v1/leaderboards/assistant & /api/v1/leaderboards/prompter
- Function in prompt_repository to calculate user scores

* Separating create vs 'eventual' evaluate routes

* Adding display_name to result

* Missing / in routes

* Updating route to be experimental

* Fixing format for pre-commit
2023-01-02 22:38:54 +01:00
Jack Michaud c7ac01718c refactor: move OasstError into oasst_shared.exceptions (#289)
* refactor: move OasstError into oasst_shared.exceptions

* fix: update OasstError import

* fix: linter errors
2023-01-02 22:03:53 +01:00
kiritowu 4796146aa7 Fix getting api_key using dependencies 2023-01-03 01:17:36 +08:00
kiritowu aa6d5786c6 Add rate limiter for task request 2023-01-03 00:28:05 +08:00
kiritowu bbf385bc07 Add TOO_MANY_REQUEST to OasstErrorCode 2023-01-03 00:28:05 +08:00
kiritowu 2a2968f6d4 Initialise redis connection for Fastapi limiter 2023-01-03 00:28:05 +08:00
kiritowu af0313ad5d Add fastapi-limiter to requirements.txt 2023-01-03 00:28:05 +08:00
Gareth Davidson 7000e10bc0 apply pre-commit rules 2023-01-02 00:01:45 +00:00
Gareth Davidson c3c7a1701a run prettier with new params 2023-01-01 20:57:35 +00:00
Jack Michaud 29b08875d4 refactor: move print_openapi_schema into main 2023-01-01 18:58:01 +01:00
Jack Michaud ea40a22049 fix: nack and ack should return empty responses 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 e15e208b20 fix: add response_model to tasks_interaction
This is required for output validation and for the mock server.
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 7b29582cbb add to protocol.Message 2022-12-31 19:23:54 +01:00
Andreas Köpf f151fa45c8 Merge branch 'main' of https://github.com/AlexanderHOtt/Open-Assistant into AlexanderHOtt-main 2022-12-31 12:54:16 +01:00
Igor Miagkov ef3a35ff9c fixes 2022-12-31 10:31:31 +01:00
Igor Miagkov 6d98ba1f75 fix alembic migration 2022-12-31 10:31:31 +01:00
Igor Miagkov f126b21bb3 adjust names and types to new naming 2022-12-31 10:31:31 +01:00
Igor Miagkov 475f48b195 stats api method 2022-12-31 10:31:31 +01:00
Igor Miagkov 8e1d80956a split message api endpoints 2022-12-31 10:31:31 +01:00
Igor Miagkov 13d01b5a2f management api 2022-12-31 10:31:31 +01:00
Alex Ott 1bdd02c821 fix breaking api changes 2022-12-30 22:52:57 -08:00
Andreas Köpf 42e9a77456 further pre-commit fixes 2022-12-31 00:18:55 +01:00
Andreas Köpf 3fe9c7a026 fix formatting in models/text_labels.py 2022-12-31 00:18:55 +01:00
Andreas Köpf 534c99610b missing 'user' -> 'prompter' replacement 2022-12-31 00:18:55 +01:00
Andreas Köpf ee14554e1b role='user' -> role='prompter' 2022-12-31 00:18:55 +01:00
Andreas Köpf 26ae43e945 additional forgotten renamings 2022-12-31 00:18:55 +01:00
Andreas Köpf 5f16a8f780 make sure alembic migration works in both directions 2022-12-31 00:18:55 +01:00
Andreas Köpf 048802fa1a add alembic migration script 2022-12-31 00:18:55 +01:00
Andreas Köpf 8b225430a4 BREAKING-CHANGES: Renaming several models/database objects + API protocol
person -> user
work_package -> task
post -> message
thread -> message_tree
2022-12-31 00:18:55 +01:00
alexandrelefourner 35e0c32a08 Updating work_package to task 2022-12-31 00:18:55 +01:00
alexandrelefourner d118f4e332 Renaming thread to message_tree 2022-12-31 00:18:55 +01:00
alexandrelefourner 7743459220 Renaming post to message 2022-12-31 00:18:55 +01:00
alexandrelefourner 9a1a4876f0 Rename of person to user 2022-12-31 00:18:55 +01:00
Alex Ott b81eeebe9e switch to using pre-commit 2022-12-30 04:35:45 -08:00
Alex Ott 65c078fb9f pre-commit changes 2022-12-30 04:12:54 -08:00
Igor Miagkov 7867466700 added trusted api client flag 2022-12-30 00:35:30 +01:00
Yannic Kilcher 3ab2e01b21 Merge pull request #128 from GraemeHarris/add-lang-column
Added column to post table for lang with US english set to default.
2022-12-29 21:33:41 +01:00
Yannic Kilcher 540f2d58c3 Merge pull request #155 from mjagkow/feature-collective-tasks
Added support for collective tasks
2022-12-29 21:18:14 +01:00
Igor Miagkov acfcd7b8d2 Fixed warning: SAWarning: Coercing Subquery object into a select() for use in IN() 2022-12-29 18:59:44 +01:00
Igor Miagkov efafc0173a added support for collective tasks 2022-12-29 21:32:17 +04:00
Graeme Harris e5c32eda21 Updates from linting 2022-12-29 19:26:30 +02:00
Igor Miagkov 4ead078f89 Added readable exception if no posts were found for task 2022-12-29 17:16:44 +01:00
Andreas Köpf c5053ed6c9 fix typo: uesr->user 2022-12-29 16:13:30 +01:00
Andreas Köpf 833549f212 add two dummy user replies depth>1 2022-12-29 15:58:35 +01:00
Andreas Köpf 30db7254c7 rename flag to DEBUG_USE_SEED_DATA default False, update compose config 2022-12-29 15:58:35 +01:00