Added site tracking
Can pick the model the use
Better handle llm model based on debug or not
This commit is contained in:
westfarn committed 2025-12-08 13:52:30 -06:00
1 parent eed1abedc8
commit 77d7edd0dc
10 files changed
+54 -17

No files matched your search

+8 -2
View File
@@ -160,6 +160,7 @@ class ChatState(TypedDict):
prompt_type: Union[PromptType, None]
response_generator: Any # AsyncGenerator or dict
error: Union[str, None]
model_name: str
# --- LangGraph Nodes ---
@@ -206,7 +207,10 @@ async def generation_node(state: ChatState) -> ChatState:
# Feature Flag: Internet Access
if prompt_type == PromptType.SEARCH:
if getattr(settings, "ALLOW_INTERNET_ACCESS", False):
# Check modelName first - if FAST, we skip search regardless of settings
if state.get("model_name") == "FAST":
pass
elif getattr(settings, "ALLOW_INTERNET_ACCESS", False):
try:
search = DuckDuckGoSearchRun()
search_results = search.run(state["message"])
@@ -274,6 +278,7 @@ class ChatConsumerGraph(AsyncWebsocketConsumer):
print("Text Data: ", text_data)
if text_data:
data = json.loads(text_data)
model = data.get("modelName", "Turbo")
message = data.get("message", None)
conversation_id = data.get("conversation_id", None)
email = data.get("email", None)
@@ -324,7 +329,8 @@ class ChatConsumerGraph(AsyncWebsocketConsumer):
"moderation_label": None,
"prompt_type": None,
"response_generator": None,
"error": None
"error": None,
"model_name": model
}
print("Initial State: ", initial_state)