mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
fix(vector-stores): preserve S3 ingest embedding model
This commit is contained in:
parent
44f2a63c09
commit
dcf1744998
2 changed files with 13 additions and 1 deletions
|
|
@ -225,6 +225,11 @@ async def _save_vector_store_to_db_from_rag_ingest(
|
|||
if key not in excluded_keys and value is not None:
|
||||
provider_specific_params[key] = value
|
||||
|
||||
embedding_config: Final = ingest_options.get("embedding")
|
||||
embedding_model: Final = embedding_config.get("model") if embedding_config else None
|
||||
if custom_llm_provider == "s3_vectors" and isinstance(embedding_model, str) and embedding_model:
|
||||
provider_specific_params["embedding_model"] = embedding_model
|
||||
|
||||
# Build file metadata entry using helper
|
||||
file_entry: Final = _build_file_metadata_entry(
|
||||
response=response,
|
||||
|
|
|
|||
|
|
@ -5805,12 +5805,19 @@ export const ragIngestCall = async (
|
|||
const formData = new FormData();
|
||||
formData.append("file", file);
|
||||
|
||||
const vectorStoreParams = { ...(providerSpecificParams ?? {}) };
|
||||
const s3EmbeddingModel = customLlmProvider === "s3_vectors" ? vectorStoreParams.embedding_model : undefined;
|
||||
if (customLlmProvider === "s3_vectors") {
|
||||
delete vectorStoreParams.embedding_model;
|
||||
}
|
||||
|
||||
const ingestOptions: any = {
|
||||
ingest_options: {
|
||||
...(typeof s3EmbeddingModel === "string" && s3EmbeddingModel && { embedding: { model: s3EmbeddingModel } }),
|
||||
vector_store: {
|
||||
custom_llm_provider: customLlmProvider,
|
||||
...(vectorStoreId && { vector_store_id: vectorStoreId }),
|
||||
...(providerSpecificParams && providerSpecificParams),
|
||||
...vectorStoreParams,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue