Make model selection optional, default to gpt-4o-mini on backend

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
This commit is contained in:
Cursor Agent 2026-02-24 21:01:30 +00:00
parent fb8eaf2f7d
commit 4f63135e1d
2 changed files with 4 additions and 3 deletions

View file

@ -177,6 +177,7 @@ async def stream_usage_ai_chat(
data: {"type": "done"}
data: {"type": "error", "message": "..."}
"""
model = model.strip() if model else ""
model = model or DEFAULT_COMPETITOR_DISCOVERY_MODEL
chat_messages: List[Dict[str, Any]] = [

View file

@ -62,7 +62,7 @@ const UsageAIChatPanel: React.FC<UsageAIChatPanelProps> = ({
};
const handleSend = async () => {
if (!accessToken || !inputText.trim() || !selectedModel || isLoading) return;
if (!accessToken || !inputText.trim() || isLoading) return;
const userMessage: ChatMessage = { role: "user", content: inputText.trim() };
const updatedMessages = [...messages, userMessage];
@ -80,7 +80,7 @@ const UsageAIChatPanel: React.FC<UsageAIChatPanelProps> = ({
await usageAiChatStream(
accessToken,
updatedMessages.map((m) => ({ role: m.role, content: m.content })),
selectedModel,
selectedModel || "",
(content: string) => {
accumulated += content;
setStreamingContent(accumulated);
@ -243,7 +243,7 @@ const UsageAIChatPanel: React.FC<UsageAIChatPanelProps> = ({
/>
<Button
onClick={handleSend}
disabled={!inputText.trim() || !selectedModel || isLoading}
disabled={!inputText.trim() || isLoading}
loading={isLoading}
>
Send