-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/add aisettings to django #927
Conversation
@@ -219,6 +221,14 @@ def get_sources_with_files( | |||
def file_save(file): | |||
return file.save() | |||
|
|||
@staticmethod | |||
@database_sync_to_async | |||
def get_ai_settings(user: User) -> AISettings: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this appears again in django_app/redbox_app/redbox_core/client.py ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't one for streamed and one for non-streamed requests?
model_name="user", | ||
name="ai_settings", | ||
field=models.ForeignKey( | ||
default="default", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL. nice
NewUser = new_state.apps.get_model("redbox_core", "User") # noqa: N806 | ||
|
||
for user in NewUser.objects.all(): | ||
assert user.ai_settings.label == "default" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perfect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
once nitpick, otherwise great stuff
b2b5171
to
ccae92c
Compare
ccae92c
to
e68cf0c
Compare
Context
After #894 AISettings can be sent to
core_api
from Django as part of the chat request. This PR implements AISettings in Django.Changes proposed in this pull request
AISettings
model with the same defaults as are currently in redbox-core (these will later be removed and kept only in Django)AISettings
labelleddefault
that is set as the default for all Django usersAISettings
to core-api as part of the chat payloadGuidance to review
Try running locally and creating your own AISettings in the Django shell.
Relevant links
https://technologyprogramme.atlassian.net/browse/REDBOX-593
Things to check