mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
fix UI validation for s3 vector store
This commit is contained in:
parent
1aa47fbbad
commit
71d1b82ad9
2 changed files with 36 additions and 4 deletions
|
|
@ -105,6 +105,18 @@ const CreateVectorStore: React.FC<CreateVectorStoreProps> = ({ accessToken, onSu
|
|||
}
|
||||
}
|
||||
|
||||
// S3 Vectors specific validation
|
||||
if (selectedProvider === "s3_vectors") {
|
||||
if (providerParams.vector_bucket_name && providerParams.vector_bucket_name.length < 3) {
|
||||
message.warning("Vector bucket name must be at least 3 characters");
|
||||
return;
|
||||
}
|
||||
if (providerParams.index_name && providerParams.index_name.length > 0 && providerParams.index_name.length < 3) {
|
||||
message.warning("Index name must be at least 3 characters if provided");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!accessToken) {
|
||||
message.error("No access token available");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -79,17 +79,27 @@ const S3VectorsConfig: React.FC<S3VectorsConfigProps> = ({
|
|||
label={
|
||||
<span>
|
||||
Vector Bucket Name{" "}
|
||||
<Tooltip title="S3 bucket name for vector storage (will be auto-created if it doesn't exist)">
|
||||
<Tooltip title="S3 bucket name for vector storage (must be at least 3 characters, lowercase letters, numbers, hyphens, and periods only)">
|
||||
<InfoCircleOutlined style={{ marginLeft: "4px" }} />
|
||||
</Tooltip>
|
||||
</span>
|
||||
}
|
||||
required
|
||||
validateStatus={
|
||||
providerParams.vector_bucket_name && providerParams.vector_bucket_name.length < 3
|
||||
? "error"
|
||||
: undefined
|
||||
}
|
||||
help={
|
||||
providerParams.vector_bucket_name && providerParams.vector_bucket_name.length < 3
|
||||
? "Bucket name must be at least 3 characters"
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<Input
|
||||
value={providerParams.vector_bucket_name || ""}
|
||||
onChange={(e) => handleFieldChange("vector_bucket_name", e.target.value)}
|
||||
placeholder="my-vector-bucket"
|
||||
placeholder="my-vector-bucket (min 3 chars)"
|
||||
size="large"
|
||||
className="rounded-md"
|
||||
/>
|
||||
|
|
@ -100,16 +110,26 @@ const S3VectorsConfig: React.FC<S3VectorsConfigProps> = ({
|
|||
label={
|
||||
<span>
|
||||
Index Name{" "}
|
||||
<Tooltip title="Name for the vector index (optional, will be auto-generated if not provided)">
|
||||
<Tooltip title="Name for the vector index (optional, will be auto-generated if not provided). If provided, must be at least 3 characters.">
|
||||
<InfoCircleOutlined style={{ marginLeft: "4px" }} />
|
||||
</Tooltip>
|
||||
</span>
|
||||
}
|
||||
validateStatus={
|
||||
providerParams.index_name && providerParams.index_name.length > 0 && providerParams.index_name.length < 3
|
||||
? "error"
|
||||
: undefined
|
||||
}
|
||||
help={
|
||||
providerParams.index_name && providerParams.index_name.length > 0 && providerParams.index_name.length < 3
|
||||
? "Index name must be at least 3 characters if provided"
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<Input
|
||||
value={providerParams.index_name || ""}
|
||||
onChange={(e) => handleFieldChange("index_name", e.target.value)}
|
||||
placeholder="my-vector-index"
|
||||
placeholder="my-vector-index (optional, min 3 chars)"
|
||||
size="large"
|
||||
className="rounded-md"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue