Skip to content

Commit

Permalink
backport search logic
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Co <alex.tuan@mindvalley.com>
  • Loading branch information
onimsha committed Nov 27, 2024
1 parent 7806de7 commit 74ac5b3
Show file tree
Hide file tree
Showing 11 changed files with 1,922 additions and 86 deletions.
Empty file.
36 changes: 36 additions & 0 deletions backend/danswer/context/search/enums.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""NOTE: this needs to be separate from models.py because of circular imports.
Both search/models.py and db/models.py import enums from this file AND
search/models.py imports from db/models.py."""
from enum import Enum


class RecencyBiasSetting(str, Enum):
FAVOR_RECENT = "favor_recent" # 2x decay rate
BASE_DECAY = "base_decay"
NO_DECAY = "no_decay"
# Determine based on query if to use base_decay or favor_recent
AUTO = "auto"


class OptionalSearchSetting(str, Enum):
ALWAYS = "always"
NEVER = "never"
# Determine whether to run search based on history and latest query
AUTO = "auto"


class SearchType(str, Enum):
KEYWORD = "keyword"
SEMANTIC = "semantic"


class LLMEvaluationType(str, Enum):
AGENTIC = "agentic" # applies agentic evaluation
BASIC = "basic" # applies boolean evaluation
SKIP = "skip" # skips evaluation
UNSPECIFIED = "unspecified" # reverts to default


class QueryFlow(str, Enum):
SEARCH = "search"
QUESTION_ANSWER = "question-answer"
Loading

0 comments on commit 74ac5b3

Please sign in to comment.