diff --git a/src/main/java/io/stargate/sgv2/jsonapi/StargateJsonApi.java b/src/main/java/io/stargate/sgv2/jsonapi/StargateJsonApi.java index e972c5e51b..827f5a8d24 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/StargateJsonApi.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/StargateJsonApi.java @@ -722,7 +722,28 @@ "tokens": [] } }, - "parameters": [], + "parameters": [ + { + "name": "organizationId", + "type": "STRING", + "defaultValue": null, + "displayName": "Organization ID", + "help": "Optional, OpenAI Organization ID. If provided passed as `OpenAI-Organization` header.", + "hint": "Add an (optional) organization ID", + "validation": {}, + "required": false + }, + { + "name": "projectId", + "type": "STRING", + "defaultValue": null, + "displayName": "Project ID", + "help": "Optional, OpenAI Project ID. If provided passed as `OpenAI-Project` header.", + "hint": "Add an (optional) project ID", + "validation": {}, + "required": false + } + ], "models": [ { "name": "text-embedding-3-small", diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/embedding/configuration/EmbeddingProvidersConfig.java b/src/main/java/io/stargate/sgv2/jsonapi/service/embedding/configuration/EmbeddingProvidersConfig.java index 94aef1d984..72a1681b5d 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/embedding/configuration/EmbeddingProvidersConfig.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/embedding/configuration/EmbeddingProvidersConfig.java @@ -158,6 +158,14 @@ interface ParameterConfig { @Nullable @JsonProperty Optional help(); + + @Nullable + @JsonProperty + Optional displayName(); + + @Nullable + @JsonProperty + Optional hint(); } enum ValidationType { diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/embedding/configuration/EmbeddingProvidersConfigImpl.java b/src/main/java/io/stargate/sgv2/jsonapi/service/embedding/configuration/EmbeddingProvidersConfigImpl.java index f0d1dc78de..5fccb0c73d 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/embedding/configuration/EmbeddingProvidersConfigImpl.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/embedding/configuration/EmbeddingProvidersConfigImpl.java @@ -50,7 +50,9 @@ public record ParameterConfigImpl( boolean required, Optional defaultValue, Map> validation, - Optional help) + Optional help, + Optional displayName, + Optional hint) implements ParameterConfig { public ParameterConfigImpl( EmbeddingGateway.GetSupportedProvidersResponse.ProviderConfig.ParameterConfig @@ -65,7 +67,9 @@ public ParameterConfigImpl( Collectors.toMap( e -> ValidationType.fromString(e.getKey()), e -> new ArrayList<>(e.getValue().getValuesList()))), - Optional.of(grpcModelParameter.getHelp())); + Optional.of(grpcModelParameter.getHelp()), + Optional.of(grpcModelParameter.getDisplayName()), + Optional.of(grpcModelParameter.getHint())); } } diff --git a/src/main/proto/embedding_gateway.proto b/src/main/proto/embedding_gateway.proto index b272e1e734..9b0f0e4fde 100644 --- a/src/main/proto/embedding_gateway.proto +++ b/src/main/proto/embedding_gateway.proto @@ -125,6 +125,8 @@ message GetSupportedProvidersResponse { //No ValidationType Enum, since enum can not be key of map in grpc message map validation = 5; string help = 6; + string display_name = 7; + string hint = 8; message IntList { repeated int32 values = 1; diff --git a/src/main/resources/embedding-providers-config.yaml b/src/main/resources/embedding-providers-config.yaml index 76dbd46305..c347f814de 100644 --- a/src/main/resources/embedding-providers-config.yaml +++ b/src/main/resources/embedding-providers-config.yaml @@ -26,10 +26,14 @@ stargate: type: string required: false help: "Optional, OpenAI Organization ID. If provided passed as `OpenAI-Organization` header." + display-name: "Organization ID" + hint: "Add an (optional) organization ID" - name: projectId type: string required: false help: "Optional, OpenAI Project ID. If provided passed as `OpenAI-Project` header." + display-name: "Project ID" + hint: "Add an (optional) project ID" properties: max-batch-size: 2048 models: @@ -175,14 +179,20 @@ stargate: type: string required: true help: "The name of your Hugging Face dedicated endpoint, the first part of the Endpoint URL." + display-name: "Endpoint name" + hint: "Add endpoint name" - name: "regionName" type: string required: true help: "The region your Hugging Face dedicated endpoint is deployed to, the second part of the Endpoint URL." + display-name: "Region name" + hint: "Add region name" - name: "cloudName" type: string required: true help: "The cloud your Hugging Face dedicated endpoint is deployed to, the third part of the Endpoint URL." + display-name: "Cloud provider where the dedicated endpoint is deployed" + hint: "Add cloud name" # OUT OF SCOPE FOR INITIAL PREVIEW vertexai: # see https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings#get_text_embeddings_for_a_snippet_of_text