Skip to content

Commit

Permalink
Refactor setup page and create preset component
Browse files Browse the repository at this point in the history
  • Loading branch information
mckaywrigley committed Jan 9, 2024
1 parent c3dda5b commit 2c080d7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
11 changes: 1 addition & 10 deletions app/setup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,7 @@ export default function SetupPage() {
stepNum={currentStep}
stepTitle="Set API Keys"
onShouldProceed={handleShouldProceed}
showNextButton={
!!(
openaiAPIKey ||
azureOpenaiAPIKey ||
anthropicAPIKey ||
googleGeminiAPIKey ||
mistralAPIKey ||
perplexityAPIKey
)
}
showNextButton={true}
showBackButton={true}
>
<APIStep
Expand Down
6 changes: 4 additions & 2 deletions components/sidebar/items/presets/create-preset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export const CreatePreset: FC<CreatePresetProps> = ({
contextLength: selectedWorkspace?.default_context_length,
includeProfileContext: selectedWorkspace?.include_profile_context,
includeWorkspaceInstructions:
selectedWorkspace?.include_workspace_instructions
selectedWorkspace?.include_workspace_instructions,
embeddingsProvider: selectedWorkspace?.embeddings_provider
})

if (!profile) return null
Expand All @@ -49,7 +50,8 @@ export const CreatePreset: FC<CreatePresetProps> = ({
context_length: presetChatSettings.contextLength,
model: presetChatSettings.model,
prompt: presetChatSettings.prompt,
temperature: presetChatSettings.temperature
temperature: presetChatSettings.temperature,
embeddings_provider: presetChatSettings.embeddingsProvider
} as TablesInsert<"presets">
}
renderInputs={() => (
Expand Down
14 changes: 7 additions & 7 deletions components/sidebar/sidebar-switcher.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { ContentType } from "@/types"
import {
IconAdjustmentsHorizontal,
IconBooks,
IconFile,
IconMessage,
IconPencil,
IconRobotFace
IconPencil
} from "@tabler/icons-react"
import { FC } from "react"
import { TabsList } from "../ui/tabs"
Expand Down Expand Up @@ -49,17 +47,19 @@ export const SidebarSwitcher: FC<SidebarSwitcherProps> = ({
onContentTypeChange={onContentTypeChange}
/>

<SidebarSwitchItem
{/* TODO */}
{/* <SidebarSwitchItem
icon={<IconBooks size={SIDEBAR_ICON_SIZE} />}
contentType="collections"
onContentTypeChange={onContentTypeChange}
/>
/> */}

<SidebarSwitchItem
{/* TODO */}
{/* <SidebarSwitchItem
icon={<IconRobotFace size={SIDEBAR_ICON_SIZE} />}
contentType="assistants"
onContentTypeChange={onContentTypeChange}
/>
/> */}
</TabsList>

<div className="flex flex-col items-center space-y-4">
Expand Down

0 comments on commit 2c080d7

Please sign in to comment.