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

simple apis now cited/context doc indices #2419

Merged
merged 2 commits into from
Sep 12, 2024
Merged

Conversation

hagen-danswer
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Sep 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 12, 2024 8:41pm

@@ -60,7 +60,11 @@ def model_dump(self, *args: list, **kwargs: dict[str, Any]) -> dict[str, Any]:


class LLMRelevanceFilterResponse(BaseModel):
relevant_chunk_indices: list[int]
llm_selected_doc_indices: list[int]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed this everywhere

@@ -1,9 +1,28 @@
import json
from datetime import datetime
from typing import Any


Copy link
Contributor Author

Choose a reason for hiding this comment

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

made this function able to encode datetime objects

elif isinstance(packet, StreamingError):
response.error_msg = packet.error
elif isinstance(packet, ChatMessageDetail):
response.message_id = packet.message_id
elif isinstance(packet, FinalUsedContextDocsResponse):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

here we get the final context docs and get the int index of that doc in the list of docs we are already returning

@@ -74,4 +74,6 @@ class ChatBasicResponse(BaseModel):
simple_search_docs: list[SimpleDoc] | None = None
error_msg: str | None = None
message_id: int | None = 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.

these are the 2 new fields (and one renamed) that we are returning through the simple apis

@@ -525,8 +523,9 @@ def _process_stream(
SearchResponseSummary, message.response
).top_sections
]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

here we yield the final context docs

backend/danswer/server/utils.py Outdated Show resolved Hide resolved
backend/ee/danswer/server/query_and_chat/chat_backend.py Outdated Show resolved Hide resolved
@hagen-danswer hagen-danswer added this pull request to the merge queue Sep 12, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 12, 2024
@hagen-danswer hagen-danswer added this pull request to the merge queue Sep 12, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 12, 2024
@hagen-danswer hagen-danswer added this pull request to the merge queue Sep 12, 2024
Merged via the queue into main with commit 604ebaf Sep 12, 2024
7 checks passed
@hagen-danswer hagen-danswer deleted the return-rag-docs branch September 12, 2024 21:50
rajivml pushed a commit to UiPath/danswer that referenced this pull request Oct 2, 2024
* simple apis now cited/context doc indices

* minor fixes
rajivml pushed a commit to UiPath/danswer that referenced this pull request Oct 2, 2024
* simple apis now cited/context doc indices

* minor fixes
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.

2 participants