@@ -56,6 +56,12 @@ https://platform.openai.com/api-keys[API keys section].
5656include::inference-shared.asciidoc[tag=api-key-admonition]
5757--
5858
59+ `dimensions`:::
60+ (Optional, integer)
61+ The number of dimensions the resulting output embeddings should have.
62+ Only supported in `text-embedding-3` and later models.
63+ If not set the OpenAI defined default for the model is used.
64+
5965`model_id`:::
6066(Required, string)
6167The name of the model to use for the {infer} task.
@@ -114,8 +120,8 @@ Specifies the user issuing the request, which can be used for abuse detection.
114120[[inference-example-openai]]
115121==== OpenAI service example
116122
117- The following example shows how to create an {infer} endpoint called
118- `openai- embeddings` to perform a `text_embedding` task type .
123+ The following example shows how to create an {infer} endpoint called `openai-embeddings` to perform a `text_embedding` task type.
124+ The embeddings created by requests to this endpoint will have 128 dimensions .
119125
120126[source,console]
121127------------------------------------------------------------
@@ -124,14 +130,14 @@ PUT _inference/text_embedding/openai-embeddings
124130 "service": "openai",
125131 "service_settings": {
126132 "api_key": "<api_key>",
127- "model_id": "text-embedding-ada-002"
133+ "model_id": "text-embedding-3-small",
134+ "dimensions": 128
128135 }
129136}
130137------------------------------------------------------------
131138// TEST[skip:TBD]
132139
133- The next example shows how to create an {infer} endpoint called
134- `openai-completion` to perform a `completion` task type.
140+ The next example shows how to create an {infer} endpoint called `openai-completion` to perform a `completion` task type.
135141
136142[source,console]
137143------------------------------------------------------------
0 commit comments