import Link from 'next/link' import { useOrgOptedIntoAi } from 'hooks/misc/useOrgOptedIntoAi' import { useSchemasForAi } from 'hooks/misc/useSchemasForAi' import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization' import { useSelectedProject } from 'hooks/misc/useSelectedProject' import { IS_PLATFORM } from 'lib/constants' import { useAppStateSnapshot } from 'state/app-state' import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button, Modal, WarningIcon, } from 'ui' import { SchemaComboBox } from './SchemaComboBox' const AISettingsModal = () => { const snap = useAppStateSnapshot() const selectedOrganization = useSelectedOrganization() const isOptedInToAI = useOrgOptedIntoAi() const selectedProject = useSelectedProject() const [selectedSchemas, setSelectedSchemas] = useSchemasForAi(selectedProject?.ref!) const includeSchemaMetadata = isOptedInToAI || !IS_PLATFORM return ( snap.setShowAiSettingsModal(false)} >

Schemas metadata to be shared with OpenAI

0 ? `${selectedSchemas.length} schema${ selectedSchemas.length > 1 ? 's' : '' } selected` : 'No schemas selected' } disabled={IS_PLATFORM && !isOptedInToAI} selectedSchemas={selectedSchemas} onSelectSchemas={setSelectedSchemas} />

Metadata includes table names, column names and their corresponding data types in the request. This will generate queries that are more relevant to your project.

{IS_PLATFORM && !isOptedInToAI && selectedOrganization && ( Your organization does not allow sending anonymous data to OpenAI This option is only available if your organization has opted-in to sending anonymous data to OpenAI. You may configure your opt-in preferences through your organization's settings. )}
) } export default AISettingsModal