mirror of
https://github.com/supabase/supabase.git
synced 2026-09-06 09:59:03 +08:00
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Feature / chore: hide assistant model selection in the UI and default chats to GPT-5.6 Luna. ## What is the current behavior? The assistant composer exposes a model picker. Paid orgs default to `gpt-5.3-codex`; everyone else defaults to `gpt-5.4-nano`. ## What is the new behavior? - The model picker is hidden in the assistant composer and Explorer home. - Chats default to `gpt-5.6-luna` with `reasoningEffort: medium`. - Model selection plumbing is kept (registry, entitlements, `setModel`, generate-v4 request body) so a requested model can still be honored when provided. - Other completion endpoints still use `gpt-5.4-nano`. ## Additional context Model selector UI can be re-enabled by passing `selectedModel` / `onSelectModel` to `AssistantChatForm`. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for the GPT-5.6 Luna model with medium reasoning capability. * Made GPT-5.6 Luna the default assistant model. * **Improvements** * Simplified assistant chat by removing model selection from the primary chat experience. * Updated model fallback behavior to use the standard assistant model. * Chat forms can now optionally display model selection when configured. * **Tests** * Updated model coverage and assistant chat tests for the new defaults and behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
88 lines
3.4 KiB
TypeScript
88 lines
3.4 KiB
TypeScript
import { MessageSquarePlus, NotebookText, SquareCode } from 'lucide-react'
|
|
import { useState } from 'react'
|
|
|
|
import { useCreateChat, useCreateNotebook, useCreateQuery } from './hooks'
|
|
import { CHAT_TEMPLATES, NOTEBOOK_TEMPLATES } from './templates'
|
|
import { ActionCard } from '@/components/layouts/Tabs/ActionCard'
|
|
import { AssistantChatForm } from '@/components/ui/AIAssistantPanel/AssistantChatForm'
|
|
|
|
export const ExplorerHomeTab = () => {
|
|
const { createNotebook } = useCreateNotebook()
|
|
const { createQuery } = useCreateQuery()
|
|
const { createChat } = useCreateChat()
|
|
|
|
const [value, setValue] = useState<string>('')
|
|
|
|
return (
|
|
<div className="bg-surface-100 h-full flex flex-col items-center justify-center">
|
|
<div className="w-full max-w-2xl">
|
|
<div className="flex items-center justify-center flex-col gap-y-1 mb-12">
|
|
<h1 className="heading-section">Explore your project</h1>
|
|
<p className="text-foreground-lighter text-sm">
|
|
Ask the Assistant about your data, or begin with a new resource.
|
|
</p>
|
|
</div>
|
|
|
|
<AssistantChatForm
|
|
loading={false}
|
|
className="bg"
|
|
placeholder="Ask anything about your project"
|
|
value={value}
|
|
onValueChange={(e) => setValue(e.target.value)}
|
|
onSubmit={(message) => createChat({ initialMessage: message })}
|
|
/>
|
|
|
|
<section className="mt-6">
|
|
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
|
<ActionCard
|
|
icon={<SquareCode className="h-4 w-4 text-foreground" strokeWidth={1.5} />}
|
|
title="Run SQL"
|
|
description="Write and run an ad-hoc query"
|
|
bgColor="bg-blue-500"
|
|
onClick={() => createQuery()}
|
|
/>
|
|
<ActionCard
|
|
icon={<NotebookText className="h-4 w-4 text-foreground" strokeWidth={1.5} />}
|
|
title="Create a notebook"
|
|
description="Combine notes, queries, and results"
|
|
bgColor="bg-blue-500"
|
|
onClick={() => createNotebook()}
|
|
/>
|
|
</div>
|
|
</section>
|
|
|
|
<section className="mt-8 flex flex-col gap-y-3">
|
|
<h2 className="text-sm font-medium text-foreground">Start with a template</h2>
|
|
|
|
<div className="grid grid-cols-1 gap-3 sm:grid-cols-3">
|
|
{NOTEBOOK_TEMPLATES.map((template) => (
|
|
<ActionCard
|
|
key={template.title}
|
|
icon={<NotebookText className="h-4 w-4 text-foreground" strokeWidth={1.5} />}
|
|
title={template.title}
|
|
description={template.description}
|
|
bgColor="bg-blue-500"
|
|
onClick={() =>
|
|
createNotebook({ name: template.title, cells: template.buildCells() })
|
|
}
|
|
/>
|
|
))}
|
|
{CHAT_TEMPLATES.map((template) => (
|
|
<ActionCard
|
|
key={template.title}
|
|
icon={<MessageSquarePlus className="h-4 w-4 text-foreground" strokeWidth={1.5} />}
|
|
title={template.title}
|
|
description={template.description}
|
|
bgColor="bg-blue-500"
|
|
onClick={() =>
|
|
createChat({ name: template.title, initialMessage: template.initialMessage })
|
|
}
|
|
/>
|
|
))}
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|