@@ -76,6 +76,12 @@ https://platform.openai.com/api-keys[API keys section].
76
76
include::inference-shared.asciidoc[tag=api-key-admonition]
77
77
--
78
78
79
+ `dimensions`:::
80
+ (Optional, integer)
81
+ The number of dimensions the resulting output embeddings should have.
82
+ Only supported in `text-embedding-3` and later models.
83
+ If not set the OpenAI defined default for the model is used.
84
+
79
85
`model_id`:::
80
86
(Required, string)
81
87
The name of the model to use for the {infer} task.
@@ -134,8 +140,8 @@ Specifies the user issuing the request, which can be used for abuse detection.
134
140
[[inference-example-openai]]
135
141
==== OpenAI service example
136
142
137
- The following example shows how to create an {infer} endpoint called
138
- `openai- embeddings` to perform a `text_embedding` task type .
143
+ The following example shows how to create an {infer} endpoint called `openai-embeddings` to perform a `text_embedding` task type.
144
+ The embeddings created by requests to this endpoint will have 128 dimensions .
139
145
140
146
[source,console]
141
147
------------------------------------------------------------
@@ -144,14 +150,14 @@ PUT _inference/text_embedding/openai-embeddings
144
150
"service": "openai",
145
151
"service_settings": {
146
152
"api_key": "<api_key>",
147
- "model_id": "text-embedding-ada-002"
153
+ "model_id": "text-embedding-3-small",
154
+ "dimensions": 128
148
155
}
149
156
}
150
157
------------------------------------------------------------
151
158
// TEST[skip:TBD]
152
159
153
- The next example shows how to create an {infer} endpoint called
154
- `openai-completion` to perform a `completion` task type.
160
+ The next example shows how to create an {infer} endpoint called `openai-completion` to perform a `completion` task type.
155
161
156
162
[source,console]
157
163
------------------------------------------------------------
0 commit comments