mirror of
https://github.com/docmost/docmost.git
synced 2026-05-17 23:14:07 +08:00
feat: add AI_EMBEDDING_SUPPORTS_MRL env var to decouple pgvector dimensions from model API (#2079)
Some embedding models don't accept a `dimensions` parameter. This adds an optional env var that controls whether the dimension is sent to the model API, while always using it for pgvector indexing. Preset models have this handled automatically; the env var allows explicit override for custom models.
This commit is contained in:
@@ -117,6 +117,12 @@ export class EnvironmentVariables {
|
||||
@IsString()
|
||||
AI_EMBEDDING_DIMENSION: string;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateIf((obj) => obj.AI_EMBEDDING_SUPPORTS_MRL)
|
||||
@IsIn(['true', 'false'])
|
||||
@IsString()
|
||||
AI_EMBEDDING_SUPPORTS_MRL: string;
|
||||
|
||||
@ValidateIf((obj) => obj.AI_DRIVER)
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
|
||||
Reference in New Issue
Block a user