Skip to content

Commit 97eef8c

Browse files
[DOCS] Documents dimensions param for openai service of Inference API (#118317) (#118333)
Co-authored-by: David Kyle <[email protected]>
1 parent 226a8ce commit 97eef8c

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

docs/reference/inference/service-openai.asciidoc

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ https://platform.openai.com/api-keys[API keys section].
7676
include::inference-shared.asciidoc[tag=api-key-admonition]
7777
--
7878

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+
7985
`model_id`:::
8086
(Required, string)
8187
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.
134140
[[inference-example-openai]]
135141
==== OpenAI service example
136142

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.
139145

140146
[source,console]
141147
------------------------------------------------------------
@@ -144,14 +150,14 @@ PUT _inference/text_embedding/openai-embeddings
144150
"service": "openai",
145151
"service_settings": {
146152
"api_key": "<api_key>",
147-
"model_id": "text-embedding-ada-002"
153+
"model_id": "text-embedding-3-small",
154+
"dimensions": 128
148155
}
149156
}
150157
------------------------------------------------------------
151158
// TEST[skip:TBD]
152159

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.
155161

156162
[source,console]
157163
------------------------------------------------------------

0 commit comments

Comments
 (0)