Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Oct 11, 2024
1 parent 0eef3ce commit 47a5e10
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
7 changes: 3 additions & 4 deletions web/src/app/admin/embeddings/pages/CloudEmbeddingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { EmbeddingDetails } from "../EmbeddingModelSelectionForm";
import { FiExternalLink, FiInfo, FiTrash } from "react-icons/fi";
import { HoverPopup } from "@/components/HoverPopup";
import { Dispatch, SetStateAction, useEffect, useState } from "react";
import { CustomModelDetailsForm } from "@/components/embedding/CustomModelDetailsForm";
import { CustomEmbeddingModelForm } from "@/components/embedding/CustomEmbeddingModelForm";
import { deleteSearchSettings } from "./utils";
import { usePopup } from "@/components/admin/connectors/Popup";
import { DeleteEntityModal } from "@/components/modals/DeleteEntityModal";
Expand Down Expand Up @@ -259,7 +259,7 @@ export default function CloudEmbeddingPage({
: ""
}`}
>
<CustomModelDetailsForm
<CustomEmbeddingModelForm
embeddingType={EmbeddingProvider.LITELLM}
provider={liteLLMProvider}
currentValues={
Expand Down Expand Up @@ -304,7 +304,6 @@ export default function CloudEmbeddingPage({

<div className="w-full flex flex-col items-start">
{!isAzureConfigured ? (
// Configuration Prompt if Azure is not configured
<>
<button
onClick={() => setShowTentativeProvider(AZURE_CLOUD_PROVIDER)}
Expand Down Expand Up @@ -380,7 +379,7 @@ export default function CloudEmbeddingPage({
}`}
>
{azureProvider && (
<CustomModelDetailsForm
<CustomEmbeddingModelForm
embeddingType={EmbeddingProvider.AZURE}
provider={azureProvider}
currentValues={
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/admin/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function Layout({ children }: { children: React.ReactNode }) {

const authTypeMetadata = results[0] as AuthTypeMetadata | null;
const user = results[1] as User | null;

console.log("authTypeMetadata", authTypeMetadata);
const authDisabled = authTypeMetadata?.authType === "disabled";
const requiresVerification = authTypeMetadata?.requiresVerification;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Dispatch, SetStateAction } from "react";
import { Button, Text } from "@tremor/react";
import { EmbeddingDetails } from "@/app/admin/embeddings/EmbeddingModelSelectionForm";

export function CustomModelDetailsForm({
export function CustomEmbeddingModelForm({
setShowTentativeModel,
currentValues,
provider,
Expand All @@ -27,7 +27,7 @@ export function CustomModelDetailsForm({
normalize: false,
query_prefix: "",
passage_prefix: "",
provider_type: EmbeddingProvider,
provider_type: embeddingType,
api_key: "",
enabled: true,
api_url: provider.api_url,
Expand Down Expand Up @@ -57,10 +57,11 @@ export function CustomModelDetailsForm({
max_tokens: Yup.number(),
})}
onSubmit={async (values) => {
console.log(values);
setShowTentativeModel(values as CloudEmbeddingModel);
}}
>
{({ isSubmitting }) => (
{({ isSubmitting, submitForm, errors }) => (
<Form>
<Text className="text-xl text-text-900 font-bold mb-4">
Specify details for your{" "}
Expand Down Expand Up @@ -107,11 +108,14 @@ export function CustomModelDetailsForm({

<Button
type="submit"
onClick={() => console.log(errors)}
disabled={isSubmitting}
className="w-64 mx-auto"
>
Configure{" "}
{embeddingType === EmbeddingProvider.AZURE ? "Azure" : "LiteLLM"}{" "}
Configure
{embeddingType === EmbeddingProvider.AZURE
? "Azure"
: "LiteLLM"}{" "}
Model
</Button>
</Form>
Expand Down

0 comments on commit 47a5e10

Please sign in to comment.