Skip to content

Commit

Permalink
The EmbeddingModel enum class of OpenAI implements the EmbeddingModel…
Browse files Browse the repository at this point in the history
…Description interface.
  • Loading branch information
bigcyy committed Feb 19, 2025
1 parent 8e23422 commit 600a337
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.ai.model.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import org.springframework.ai.model.ApiKey;
import org.springframework.ai.model.ChatModelDescription;
import org.springframework.ai.model.ModelOptionsUtils;
import org.springframework.ai.model.NoopApiKey;
import org.springframework.ai.model.SimpleApiKey;
import org.springframework.ai.openai.api.common.OpenAiApiConstants;
import org.springframework.ai.retry.RetryUtils;
import org.springframework.core.ParameterizedTypeReference;
Expand All @@ -62,6 +58,7 @@
* @author Thomas Vitale
* @author David Frizelle
* @author Alexandros Pappas
* @author Chen Yang
*/
public class OpenAiApi {

Expand Down Expand Up @@ -622,7 +619,7 @@ public enum ChatCompletionFinishReason {
* OpenAI Embeddings Models:
* <a href="https://platform.openai.com/docs/models/embeddings">Embeddings</a>.
*/
public enum EmbeddingModel {
public enum EmbeddingModel implements EmbeddingModelDescription {

/**
* Most capable embedding model for both english and non-english tasks. DIMENSION:
Expand Down Expand Up @@ -651,6 +648,10 @@ public String getValue() {
return this.value;
}

@Override
public String getName() {
return this.value;
}
}

/**
Expand Down

0 comments on commit 600a337

Please sign in to comment.