mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-02 22:01:05 +02:00
chore: cleanup
This commit is contained in:
parent
82a4eb3966
commit
a1aad295bb
4 changed files with 16 additions and 23 deletions
|
|
@ -4,15 +4,18 @@ SECRET_KEY="SECRET"
|
|||
GOOGLE_OAUTH_CLIENT_ID="924507538m"
|
||||
GOOGLE_OAUTH_CLIENT_SECRET="GOCSV"
|
||||
NEXT_FRONTEND_URL="http://localhost:3000"
|
||||
|
||||
EMBEDDING_MODEL="mixedbread-ai/mxbai-embed-large-v1"
|
||||
|
||||
RERANKERS_MODEL_NAME="ms-marco-MiniLM-L-12-v2"
|
||||
RERANKERS_MODEL_TYPE="flashrank"
|
||||
|
||||
FAST_LLM="litellm:openai/gpt-4o-mini"
|
||||
STRATEGIC_LLM="litellm:openai/gpt-4o"
|
||||
LONG_CONTEXT_LLM="litellm:gemini/gemini-2.0-flash"
|
||||
# https://docs.litellm.ai/docs/providers
|
||||
FAST_LLM="openai/gpt-4o-mini"
|
||||
STRATEGIC_LLM="openai/gpt-4o"
|
||||
LONG_CONTEXT_LLM="gemini/gemini-2.0-flash"
|
||||
|
||||
# Chosen LiteLLM Providers Keys
|
||||
OPENAI_API_KEY="sk-proj-iA"
|
||||
GEMINI_API_KEY="AIzaSyB6-1641124124124124124124124124124"
|
||||
|
||||
|
|
|
|||
|
|
@ -37,8 +37,9 @@ async def rerank_documents(state: State, config: RunnableConfig) -> Dict[str, An
|
|||
if reranker_service:
|
||||
try:
|
||||
# Use the sub-section questions for reranking context
|
||||
rerank_query = "\n".join(sub_section_questions)
|
||||
|
||||
# rerank_query = "\n".join(sub_section_questions)
|
||||
rerank_query = configuration.user_query
|
||||
|
||||
# Convert documents to format expected by reranker if needed
|
||||
reranker_input_docs = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,17 +15,6 @@ env_file = BASE_DIR / ".env"
|
|||
load_dotenv(env_file)
|
||||
|
||||
|
||||
def extract_model_name(llm_string: str) -> str:
|
||||
"""Extract the model name from an LLM string.
|
||||
Example: "litellm:openai/gpt-4o-mini" -> "openai/gpt-4o-mini"
|
||||
|
||||
Args:
|
||||
llm_string: The LLM string with optional prefix
|
||||
|
||||
Returns:
|
||||
str: The extracted model name
|
||||
"""
|
||||
return llm_string.split(":", 1)[1] if ":" in llm_string else llm_string
|
||||
|
||||
class Config:
|
||||
# Database
|
||||
|
|
@ -38,13 +27,13 @@ class Config:
|
|||
|
||||
# LONG-CONTEXT LLMS
|
||||
LONG_CONTEXT_LLM = os.getenv("LONG_CONTEXT_LLM")
|
||||
long_context_llm_instance = ChatLiteLLM(model=extract_model_name(LONG_CONTEXT_LLM))
|
||||
long_context_llm_instance = ChatLiteLLM(model=LONG_CONTEXT_LLM)
|
||||
|
||||
# GPT Researcher
|
||||
FAST_LLM = os.getenv("FAST_LLM")
|
||||
STRATEGIC_LLM = os.getenv("STRATEGIC_LLM")
|
||||
fast_llm_instance = ChatLiteLLM(model=extract_model_name(FAST_LLM))
|
||||
strategic_llm_instance = ChatLiteLLM(model=extract_model_name(STRATEGIC_LLM))
|
||||
fast_llm_instance = ChatLiteLLM(model=FAST_LLM)
|
||||
strategic_llm_instance = ChatLiteLLM(model=STRATEGIC_LLM)
|
||||
|
||||
|
||||
# Chonkie Configuration | Edit this to your needs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue