-
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
Add Citations to Django app #641
Add Citations to Django app #641
Conversation
7aaf874
to
154ea96
Compare
1229760
to
3628025
Compare
Move all database activity into @database_sync_to_async methods.
linting update migration numbers update poetry.lock
3628025
to
a78d268
Compare
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.
LGTM, pending the integration tests you have running.
django_app/tests/test_migrations.py
Outdated
|
||
|
||
@pytest.mark.django_db() | ||
def test_0019_remove_chatmessage_source_files_textchunk_and_more(migrator): |
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.
World's tiniest nitpick.
def test_0019_remove_chatmessage_source_files_textchunk_and_more(migrator): | |
def test_0020_remove_chatmessage_source_files_textchunk_and_more(migrator): |
Citation.objects.create(chat_message=chat_message, file=file, text=doc.page_content) | ||
if sources: | ||
for file, citations in sources: | ||
for citation in citations: |
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.
magic, good spot :)
Context
Although the core-api returns citations, we don't currently record or store these in Django. It might be useful to do this for 2 reasons:
Changes proposed in this pull request
Citation
model to the django appTo follow in a later PR
Guidance to review
Try some RAG chats locally; take a look in Django Admin for the Citation records.
Relevant links
https://technologyprogramme.atlassian.net/browse/REDBOX-367
Things to check