mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-19 12:03:54 +02:00
Explain Chat History Structure (#913)
This commit is contained in:
@@ -66,17 +66,33 @@ class DocumentSearchRequest(BaseModel):
|
|||||||
skip_rerank: bool = False
|
skip_rerank: bool = False
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
Currently the different branches are generated by changing the search query
|
||||||
|
|
||||||
|
[Empty Root Message] This allows the first message to be branched as well
|
||||||
|
/ | \
|
||||||
|
[First Message] [First Message Edit 1] [First Message Edit 2]
|
||||||
|
| |
|
||||||
|
[Second Message] [Second Message of Edit 1 Branch]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
class CreateChatMessageRequest(BaseModel):
|
class CreateChatMessageRequest(BaseModel):
|
||||||
|
"""Before creating messages, be sure to create a chat_session and get an id"""
|
||||||
|
|
||||||
chat_session_id: int
|
chat_session_id: int
|
||||||
|
# This is the primary-key (unique identifier) for the previous message of the tree
|
||||||
parent_message_id: int | None
|
parent_message_id: int | None
|
||||||
|
# New message contents
|
||||||
message: str
|
message: str
|
||||||
# If no prompt provided, provide canned retrieval answer, no actually LLM flow
|
# If no prompt provided, provide canned retrieval answer, no actually LLM flow
|
||||||
|
# Use prompt_id 0 to use the system default prompt which is Answer-Question
|
||||||
prompt_id: int | None
|
prompt_id: int | None
|
||||||
# If search_doc_ids provided, then retrieval options are unused
|
# If search_doc_ids provided, then retrieval options are unused
|
||||||
search_doc_ids: list[int] | None
|
search_doc_ids: list[int] | None
|
||||||
retrieval_options: RetrievalDetails | None
|
retrieval_options: RetrievalDetails | None
|
||||||
# allows the caller to specify the exact search query they want to use
|
# allows the caller to specify the exact search query they want to use
|
||||||
# will disable query re-wording if specified
|
# will disable Query Rewording if specified
|
||||||
query_override: str | None = None
|
query_override: str | None = None
|
||||||
|
|
||||||
@root_validator
|
@root_validator
|
||||||
@@ -87,7 +103,7 @@ class CreateChatMessageRequest(BaseModel):
|
|||||||
|
|
||||||
if search_doc_ids is None and retrieval_options is None:
|
if search_doc_ids is None and retrieval_options is None:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Either search_doc_ids or retrieval_options must be provided, but not both None."
|
"Either search_doc_ids or retrieval_options must be provided, but not both or neither."
|
||||||
)
|
)
|
||||||
|
|
||||||
return values
|
return values
|
||||||
|
Reference in New Issue
Block a user