Skip to content
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

REDBOX 337 chat file selection #556

Merged
merged 32 commits into from
Jun 12, 2024
Merged

Conversation

brunns
Copy link
Contributor

@brunns brunns commented Jun 11, 2024

Context

See https://technologyprogramme.atlassian.net/browse/REDBOX-337

This PR adds file_uuid param to core-api RAG endpoints, and update django to use them

Changes proposed in this pull request

Guidance to review

Relevant links

Things to check

search_kwargs = {"filter": {"term": {"creator_user_uuid.keyword": str(user_uuid)}}}
search_kwargs = {"filter": {"bool": {"must": [{"term": {"creator_user_uuid.keyword": str(user_uuid)}}]}}}

if chat_request.selected_files is not None:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if chat_request.selected_files is not None:
if chat_request.selected_files:

selected_files should never be None - the model uses a default factory.

@@ -15,6 +15,10 @@ class FileResource(admin.ModelAdmin):
list_display = ["original_file_name", "user", "status"]


class ChatMessageResource(admin.ModelAdmin):
list_display = ["chat_history", "text", "role"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
list_display = ["chat_history", "text", "role"]
list_display = ["chat_history", "text", "role", "created_at"]

search_kwargs["filter"]["bool"]["should"] = [
if chat_request.selected_files:
logging.info("chat_request.selected_files: %s", str(chat_request.selected_files))
search_kwargs["filter"]["bool"]["must"] = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shoot me

@gecBurton gecBurton merged commit a1d930c into main Jun 12, 2024
10 checks passed
@gecBurton gecBurton deleted the feature/REDBOX-337-chat-file-selection branch June 12, 2024 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants