Skip to content

Commit 5fe035b

Browse files
CreatmanCEOclaude
andcommitted
fix: add Cerebras to pool-b fallback chain + welcome message in chat
1. Pool B now: Anthropic Haiku → Gemini Flash → Cerebras Llama (3 providers). Pool B upgrade: Anthropic Sonnet → Gemini Flash (2 providers). Ensures chat works even when 1-2 providers are down. 2. Chat panel shows welcome message on startup: what the app does, capabilities list, usage instructions, quick action suggestion buttons. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d973797 commit 5fe035b

2 files changed

Lines changed: 54 additions & 8 deletions

File tree

backend/services/llm_router.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def create_router() -> Router:
3939
"api_key": settings.cerebras_api_key.get_secret_value(),
4040
},
4141
},
42-
# Pool B — complex tasks (Anthropic primary, Gemini fallback)
42+
# Pool B — complex tasks (Anthropic Gemini → Cerebras fallback chain)
4343
{
4444
"model_name": "pool-b",
4545
"litellm_params": {
@@ -54,13 +54,28 @@ def create_router() -> Router:
5454
"api_key": settings.gemini_api_key.get_secret_value(),
5555
},
5656
},
57+
{
58+
"model_name": "pool-b",
59+
"litellm_params": {
60+
"model": settings.model_pool_a_fallback,
61+
"api_key": settings.cerebras_api_key.get_secret_value(),
62+
},
63+
},
64+
# Pool B upgrade — same fallback chain
5765
{
5866
"model_name": "pool-b-upgrade",
5967
"litellm_params": {
6068
"model": settings.model_pool_b_complex,
6169
"api_key": settings.anthropic_api_key.get_secret_value(),
6270
},
6371
},
72+
{
73+
"model_name": "pool-b-upgrade",
74+
"litellm_params": {
75+
"model": settings.model_pool_a_primary,
76+
"api_key": settings.gemini_api_key.get_secret_value(),
77+
},
78+
},
6479
]
6580

6681
return Router(

frontend/src/components/Chat/ChatPanel.tsx

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,51 @@ export function ChatPanel() {
8282
{/* Messages */}
8383
<div className="flex-1 overflow-y-auto px-4 py-3 space-y-1">
8484
{messages.length === 0 && !streamingText && (
85-
<div className="text-center text-gray-400 text-sm mt-8">
86-
<p className="mb-3">Ask about wells, anomalies, or upload CSV data.</p>
87-
<div className="space-y-2 text-xs">
85+
<div className="px-2 py-4">
86+
{/* Welcome message styled as assistant bubble */}
87+
<div className="flex justify-start mb-4">
88+
<div className="max-w-[92%] bg-gray-100 text-gray-900 rounded-2xl rounded-bl-md px-4 py-3">
89+
<p className="text-sm font-medium mb-2">Welcome to HydroWatch AI</p>
90+
<p className="text-sm text-gray-600 mb-3">
91+
I am your groundwater monitoring assistant for the Abu Dhabi aquifer network.
92+
I can analyze 25 monitoring wells across 4 clusters in real time.
93+
</p>
94+
95+
<p className="text-xs font-medium text-gray-500 uppercase mb-2">What I can do:</p>
96+
<ul className="text-sm text-gray-600 space-y-1 mb-3">
97+
<li>&#x1F4CD; Query wells by location, status, or cluster</li>
98+
<li>&#x26A0;&#xFE0F; Detect anomalies: debit decline, TDS spikes, sensor faults</li>
99+
<li>&#x1F4C8; Analyze time series trends for any parameter</li>
100+
<li>&#x1F4CA; Regional statistics for the current viewport</li>
101+
<li>&#x1F4C4; Validate uploaded CSV observation files</li>
102+
</ul>
103+
104+
<p className="text-xs font-medium text-gray-500 uppercase mb-2">How to use:</p>
105+
<ul className="text-xs text-gray-500 space-y-1 mb-3">
106+
<li>&bull; Click a well on the map &mdash; I&apos;ll see which one you selected</li>
107+
<li>&bull; Pan/zoom the map &mdash; I know your current viewport</li>
108+
<li>&bull; Toggle layers (Wells, Depression Cones) in the top-right panel</li>
109+
<li>&bull; Upload CSV via the <strong>CSV</strong> button above</li>
110+
<li>&bull; View model metrics via the <strong>Metrics</strong> button</li>
111+
</ul>
112+
</div>
113+
</div>
114+
115+
{/* Quick action suggestions */}
116+
<p className="text-xs text-gray-400 text-center mb-2">Try asking:</p>
117+
<div className="flex flex-wrap gap-2 justify-center">
88118
{[
89119
"Show anomalies in the viewport",
90-
"What is the status of well AUH-01-003?",
91-
"Region statistics for visible area",
120+
"Status of well AUH-01-003",
121+
"Region statistics",
122+
"Which wells have high TDS?",
92123
].map((suggestion) => (
93124
<button
94125
key={suggestion}
95126
onClick={() => setInput(suggestion)}
96-
className="block mx-auto text-gray-400 hover:text-blue-500 transition-colors cursor-pointer"
127+
className="text-xs px-3 py-1.5 rounded-full border border-gray-200 text-gray-500 hover:border-blue-400 hover:text-blue-600 transition-colors"
97128
>
98-
&rarr; {suggestion}
129+
{suggestion}
99130
</button>
100131
))}
101132
</div>

0 commit comments

Comments
 (0)