Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The EmbeddingModel enum class of OpenAI implements the EmbeddingModelDescription interface #2277

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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