mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-03-29 11:12:02 +01:00
Default Values (#1130)
This commit is contained in:
parent
0f23effe7e
commit
6d5340ae07
@ -120,6 +120,8 @@ def stream_answer_objects(
|
||||
user_query=query_msg.message,
|
||||
history_str=history_str,
|
||||
)
|
||||
# Given back ahead of the documents for latency reasons
|
||||
# In chat flow it's given back along with the documents
|
||||
yield QueryRephrase(rephrased_query=rephrased_query)
|
||||
|
||||
(
|
||||
@ -154,6 +156,7 @@ def stream_answer_objects(
|
||||
|
||||
# Since this is in the one shot answer flow, we don't need to actually save the docs to DB
|
||||
initial_response = QADocsResponse(
|
||||
rephrased_query=rephrased_query,
|
||||
top_documents=fake_saved_docs,
|
||||
predicted_flow=predicted_flow,
|
||||
predicted_search=predicted_search_type,
|
||||
|
@ -1,6 +1,7 @@
|
||||
from typing import Any
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import Field
|
||||
from pydantic import root_validator
|
||||
|
||||
from danswer.chat.models import DanswerContexts
|
||||
@ -17,14 +18,14 @@ class QueryRephrase(BaseModel):
|
||||
class ThreadMessage(BaseModel):
|
||||
message: str
|
||||
sender: str | None
|
||||
role: MessageType
|
||||
role: MessageType = MessageType.USER
|
||||
|
||||
|
||||
class DirectQARequest(BaseModel):
|
||||
messages: list[ThreadMessage]
|
||||
prompt_id: int | None
|
||||
persona_id: int
|
||||
retrieval_options: RetrievalDetails
|
||||
retrieval_options: RetrievalDetails = Field(default_factory=RetrievalDetails)
|
||||
chain_of_thought: bool = False
|
||||
return_contexts: bool = False
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user