Skip to content

Commit

Permalink
Remove vectorDimension:0 for range dimension in `findEmbeddingProvi…
Browse files Browse the repository at this point in the history
…ders` (#1121)
  • Loading branch information
Hazel-Datastax authored May 28, 2024
1 parent 5104a23 commit 1a8b04c
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public ModelConfigImpl(
List<ParameterConfig> modelParameterList) {
this(
grpcModelConfig.getName(),
Optional.ofNullable(grpcModelConfig.getVectorDimension()),
grpcModelConfig.hasVectorDimension()
? Optional.of(grpcModelConfig.getVectorDimension())
: Optional.empty(),
modelParameterList,
grpcModelConfig.getPropertiesMap());
}
Expand All @@ -57,13 +59,13 @@ public ParameterConfigImpl(
grpcModelParameter.getName(),
ParameterType.valueOf(grpcModelParameter.getType().name()),
grpcModelParameter.getRequired(),
Optional.ofNullable(grpcModelParameter.getDefaultValue()),
Optional.of(grpcModelParameter.getDefaultValue()),
grpcModelParameter.getValidationMap().entrySet().stream()
.collect(
Collectors.toMap(
e -> ValidationType.fromString(e.getKey()),
e -> new ArrayList<>(e.getValue().getValuesList()))),
Optional.ofNullable(grpcModelParameter.getHelp()));
Optional.of(grpcModelParameter.getHelp()));
}
}

Expand All @@ -82,9 +84,9 @@ public RequestPropertiesImpl(
grpcProviderConfigProperties.getMaxRetries(),
grpcProviderConfigProperties.getRetryDelayMillis(),
grpcProviderConfigProperties.getRequestTimeoutMillis(),
Optional.ofNullable(grpcProviderConfigProperties.getMaxInputLength()),
Optional.ofNullable(grpcProviderConfigProperties.getTaskTypeStore()),
Optional.ofNullable(grpcProviderConfigProperties.getTaskTypeRead()));
Optional.of(grpcProviderConfigProperties.getMaxInputLength()),
Optional.of(grpcProviderConfigProperties.getTaskTypeStore()),
Optional.of(grpcProviderConfigProperties.getTaskTypeRead()));
}
}
}
Expand Down

0 comments on commit 1a8b04c

Please sign in to comment.