mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-17 00:23:09 +02:00
Default Values (#1130)
This commit is contained in:
@ -120,6 +120,8 @@ def stream_answer_objects(
|
|||||||
user_query=query_msg.message,
|
user_query=query_msg.message,
|
||||||
history_str=history_str,
|
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)
|
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
|
# Since this is in the one shot answer flow, we don't need to actually save the docs to DB
|
||||||
initial_response = QADocsResponse(
|
initial_response = QADocsResponse(
|
||||||
|
rephrased_query=rephrased_query,
|
||||||
top_documents=fake_saved_docs,
|
top_documents=fake_saved_docs,
|
||||||
predicted_flow=predicted_flow,
|
predicted_flow=predicted_flow,
|
||||||
predicted_search=predicted_search_type,
|
predicted_search=predicted_search_type,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
from pydantic import Field
|
||||||
from pydantic import root_validator
|
from pydantic import root_validator
|
||||||
|
|
||||||
from danswer.chat.models import DanswerContexts
|
from danswer.chat.models import DanswerContexts
|
||||||
@ -17,14 +18,14 @@ class QueryRephrase(BaseModel):
|
|||||||
class ThreadMessage(BaseModel):
|
class ThreadMessage(BaseModel):
|
||||||
message: str
|
message: str
|
||||||
sender: str | None
|
sender: str | None
|
||||||
role: MessageType
|
role: MessageType = MessageType.USER
|
||||||
|
|
||||||
|
|
||||||
class DirectQARequest(BaseModel):
|
class DirectQARequest(BaseModel):
|
||||||
messages: list[ThreadMessage]
|
messages: list[ThreadMessage]
|
||||||
prompt_id: int | None
|
prompt_id: int | None
|
||||||
persona_id: int
|
persona_id: int
|
||||||
retrieval_options: RetrievalDetails
|
retrieval_options: RetrievalDetails = Field(default_factory=RetrievalDetails)
|
||||||
chain_of_thought: bool = False
|
chain_of_thought: bool = False
|
||||||
return_contexts: bool = False
|
return_contexts: bool = False
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user