mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-04 19:50:57 +02:00
close to functioning
This commit is contained in:
@ -135,7 +135,7 @@ POSTGRES_PASSWORD = urllib.parse.quote_plus(
|
|||||||
os.environ.get("POSTGRES_PASSWORD") or "password"
|
os.environ.get("POSTGRES_PASSWORD") or "password"
|
||||||
)
|
)
|
||||||
POSTGRES_HOST = os.environ.get("POSTGRES_HOST") or "localhost"
|
POSTGRES_HOST = os.environ.get("POSTGRES_HOST") or "localhost"
|
||||||
POSTGRES_PORT = os.environ.get("POSTGRES_PORT") or "5433"
|
POSTGRES_PORT = os.environ.get("POSTGRES_PORT") or "5432"
|
||||||
POSTGRES_DB = os.environ.get("POSTGRES_DB") or "postgres"
|
POSTGRES_DB = os.environ.get("POSTGRES_DB") or "postgres"
|
||||||
|
|
||||||
# defaults to False
|
# defaults to False
|
||||||
|
@ -52,8 +52,8 @@ class InferenceSettings(RerankingDetails):
|
|||||||
|
|
||||||
|
|
||||||
class SearchSettingsCreationRequest(InferenceSettings, IndexingSetting):
|
class SearchSettingsCreationRequest(InferenceSettings, IndexingSetting):
|
||||||
api_key_set: bool
|
api_key_set: bool = False
|
||||||
rerank_api_key_set: bool
|
rerank_api_key_set: bool = False
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_db_model(
|
def from_db_model(
|
||||||
|
@ -15,6 +15,7 @@ import {
|
|||||||
import { Modal } from "@/components/Modal";
|
import { Modal } from "@/components/Modal";
|
||||||
import { Button } from "@tremor/react";
|
import { Button } from "@tremor/react";
|
||||||
import { TextFormField } from "@/components/admin/connectors/Field";
|
import { TextFormField } from "@/components/admin/connectors/Field";
|
||||||
|
import { defaultPasswordMask } from "@/lib/llm/utils";
|
||||||
|
|
||||||
interface RerankingDetailsFormProps {
|
interface RerankingDetailsFormProps {
|
||||||
setRerankingDetails: Dispatch<SetStateAction<RerankingDetails>>;
|
setRerankingDetails: Dispatch<SetStateAction<RerankingDetails>>;
|
||||||
@ -38,6 +39,7 @@ const RerankingDetailsForm = forwardRef<
|
|||||||
},
|
},
|
||||||
ref
|
ref
|
||||||
) => {
|
) => {
|
||||||
|
console.log(originalRerankingDetails);
|
||||||
const [isApiKeyModalOpen, setIsApiKeyModalOpen] = useState(false);
|
const [isApiKeyModalOpen, setIsApiKeyModalOpen] = useState(false);
|
||||||
const [showLiteLLMConfigurationModal, setShowLiteLLMConfigurationModal] =
|
const [showLiteLLMConfigurationModal, setShowLiteLLMConfigurationModal] =
|
||||||
useState(false);
|
useState(false);
|
||||||
@ -254,8 +256,8 @@ const RerankingDetailsForm = forwardRef<
|
|||||||
<TextFormField
|
<TextFormField
|
||||||
subtext="Set the key to access your LiteLLM Proxy"
|
subtext="Set the key to access your LiteLLM Proxy"
|
||||||
placeholder={
|
placeholder={
|
||||||
values.rerank_api_key
|
originalRerankingDetails.rerank_api_key_set
|
||||||
? "*".repeat(values.rerank_api_key.length)
|
? defaultPasswordMask
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
@ -327,8 +329,8 @@ const RerankingDetailsForm = forwardRef<
|
|||||||
<div className="w-full px-4">
|
<div className="w-full px-4">
|
||||||
<TextFormField
|
<TextFormField
|
||||||
placeholder={
|
placeholder={
|
||||||
values.rerank_api_key
|
originalRerankingDetails.rerank_api_key_set
|
||||||
? "*".repeat(values.rerank_api_key.length)
|
? defaultPasswordMask
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
@ -7,6 +7,7 @@ export interface RerankingDetails {
|
|||||||
rerank_provider_type: RerankerProvider | null;
|
rerank_provider_type: RerankerProvider | null;
|
||||||
rerank_api_key: string | null;
|
rerank_api_key: string | null;
|
||||||
rerank_api_url: string | null;
|
rerank_api_url: string | null;
|
||||||
|
rerank_api_key_set?: boolean;
|
||||||
}
|
}
|
||||||
export interface RerankingDetailsSnapshot
|
export interface RerankingDetailsSnapshot
|
||||||
extends Omit<RerankingDetails, "rerank_api_key"> {
|
extends Omit<RerankingDetails, "rerank_api_key"> {
|
||||||
|
@ -127,6 +127,7 @@ export default function EmbeddingForm() {
|
|||||||
rerank_provider_type: searchSettings.rerank_provider_type,
|
rerank_provider_type: searchSettings.rerank_provider_type,
|
||||||
rerank_model_name: searchSettings.rerank_model_name,
|
rerank_model_name: searchSettings.rerank_model_name,
|
||||||
rerank_api_url: searchSettings.rerank_api_url,
|
rerank_api_url: searchSettings.rerank_api_url,
|
||||||
|
rerank_api_key_set: searchSettings.rerank_api_key_set,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [searchSettings]);
|
}, [searchSettings]);
|
||||||
@ -137,12 +138,14 @@ export default function EmbeddingForm() {
|
|||||||
rerank_provider_type: searchSettings.rerank_provider_type,
|
rerank_provider_type: searchSettings.rerank_provider_type,
|
||||||
rerank_model_name: searchSettings.rerank_model_name,
|
rerank_model_name: searchSettings.rerank_model_name,
|
||||||
rerank_api_url: searchSettings.rerank_api_url,
|
rerank_api_url: searchSettings.rerank_api_url,
|
||||||
|
rerank_api_key_set: searchSettings.rerank_api_key_set,
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
rerank_api_key: "",
|
rerank_api_key: "",
|
||||||
rerank_provider_type: null,
|
rerank_provider_type: null,
|
||||||
rerank_model_name: "",
|
rerank_model_name: "",
|
||||||
rerank_api_url: null,
|
rerank_api_url: null,
|
||||||
|
rerank_api_key_set: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Reference in New Issue
Block a user