Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.17] [DOCS] Documents dimensions param for openai service of Inference API (#118317) #118332

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions docs/reference/inference/service-openai.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ https://platform.openai.com/api-keys[API keys section].
include::inference-shared.asciidoc[tag=api-key-admonition]
--

`dimensions`:::
(Optional, integer)
The number of dimensions the resulting output embeddings should have.
Only supported in `text-embedding-3` and later models.
If not set the OpenAI defined default for the model is used.

`model_id`:::
(Required, string)
The name of the model to use for the {infer} task.
Expand Down Expand Up @@ -134,8 +140,8 @@ Specifies the user issuing the request, which can be used for abuse detection.
[[inference-example-openai]]
==== OpenAI service example

The following example shows how to create an {infer} endpoint called
`openai-embeddings` to perform a `text_embedding` task type.
The following example shows how to create an {infer} endpoint called `openai-embeddings` to perform a `text_embedding` task type.
The embeddings created by requests to this endpoint will have 128 dimensions.

[source,console]
------------------------------------------------------------
Expand All @@ -144,14 +150,14 @@ PUT _inference/text_embedding/openai-embeddings
"service": "openai",
"service_settings": {
"api_key": "<api_key>",
"model_id": "text-embedding-ada-002"
"model_id": "text-embedding-3-small",
"dimensions": 128
}
}
------------------------------------------------------------
// TEST[skip:TBD]

The next example shows how to create an {infer} endpoint called
`openai-completion` to perform a `completion` task type.
The next example shows how to create an {infer} endpoint called `openai-completion` to perform a `completion` task type.

[source,console]
------------------------------------------------------------
Expand Down
Loading