Skip to content
This repository was archived by the owner on Dec 11, 2024. It is now read-only.

Commit 74ac5b3

Browse files
committed
backport search logic
Signed-off-by: Alex Co <alex.tuan@mindvalley.com>
1 parent 7806de7 commit 74ac5b3

File tree

11 files changed

+1922
-86
lines changed

11 files changed

+1922
-86
lines changed

backend/danswer/context/search/__init__.py

Whitespace-only changes.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""NOTE: this needs to be separate from models.py because of circular imports.
2+
Both search/models.py and db/models.py import enums from this file AND
3+
search/models.py imports from db/models.py."""
4+
from enum import Enum
5+
6+
7+
class RecencyBiasSetting(str, Enum):
8+
FAVOR_RECENT = "favor_recent" # 2x decay rate
9+
BASE_DECAY = "base_decay"
10+
NO_DECAY = "no_decay"
11+
# Determine based on query if to use base_decay or favor_recent
12+
AUTO = "auto"
13+
14+
15+
class OptionalSearchSetting(str, Enum):
16+
ALWAYS = "always"
17+
NEVER = "never"
18+
# Determine whether to run search based on history and latest query
19+
AUTO = "auto"
20+
21+
22+
class SearchType(str, Enum):
23+
KEYWORD = "keyword"
24+
SEMANTIC = "semantic"
25+
26+
27+
class LLMEvaluationType(str, Enum):
28+
AGENTIC = "agentic" # applies agentic evaluation
29+
BASIC = "basic" # applies boolean evaluation
30+
SKIP = "skip" # skips evaluation
31+
UNSPECIFIED = "unspecified" # reverts to default
32+
33+
34+
class QueryFlow(str, Enum):
35+
SEARCH = "search"
36+
QUESTION_ANSWER = "question-answer"

0 commit comments

Comments
 (0)