Skip to content

Commit 7c39cfa

Browse files
[DOCS] Documents dimensions param for openai service of Inference API (#118317) (#118334)
Co-authored-by: David Kyle <[email protected]>
1 parent df7ebe7 commit 7c39cfa

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
@@ -56,6 +56,12 @@ https://platform.openai.com/api-keys[API keys section].
5656
include::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)
6167
The 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

Comments
 (0)