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