Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/simple_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from api.chat import ChatStreamer, prompt_builder, is_token_limit_error
from api.config import get_model_config, configs
from api.data_pipeline import count_tokens, get_file_content
from api.rag import RAG
from api.rag import RAG, MAX_INPUT_TOKENS
from api.prompts import (
DEEP_RESEARCH_FIRST_ITERATION_PROMPT,
DEEP_RESEARCH_FINAL_ITERATION_PROMPT,
Expand Down Expand Up @@ -78,8 +78,8 @@ async def chat_completions_stream(request: ChatCompletionRequest):
if hasattr(last_message, 'content') and last_message.content:
tokens = count_tokens(last_message.content, request.provider == "ollama")
logger.info(f"Request size: {tokens} tokens")
if tokens > 8000:
logger.warning(f"Request exceeds recommended token limit ({tokens} > 7500)")
if tokens > MAX_INPUT_TOKENS:
logger.warning(f"Request exceeds recommended token limit ({tokens} > {MAX_INPUT_TOKENS})")
input_too_large = True

# Create a new RAG instance for this request
Expand Down
6 changes: 3 additions & 3 deletions api/websocket_wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
configs,
)
from api.data_pipeline import count_tokens, get_file_content
from api.rag import RAG
from api.rag import RAG, MAX_INPUT_TOKENS
from api.prompts import (
DEEP_RESEARCH_FIRST_ITERATION_PROMPT,
DEEP_RESEARCH_FINAL_ITERATION_PROMPT,
Expand Down Expand Up @@ -75,8 +75,8 @@ async def handle_websocket_chat(websocket: WebSocket):
if hasattr(last_message, 'content') and last_message.content:
tokens = count_tokens(last_message.content, request.provider == "ollama")
logger.info(f"Request size: {tokens} tokens")
if tokens > 8000:
logger.warning(f"Request exceeds recommended token limit ({tokens} > 7500)")
if tokens > MAX_INPUT_TOKENS:
logger.warning(f"Request exceeds recommended token limit ({tokens} > {MAX_INPUT_TOKENS})")
input_too_large = True

# Create a new RAG instance for this request
Expand Down
Loading