Skip to content

Commit

Permalink
[8.14][DOCS] Documents dimensions param for openai service of Inferen…
Browse files Browse the repository at this point in the history
…ce API.
  • Loading branch information
szabosteve committed Dec 10, 2024
1 parent 699b149 commit d50fa37
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions docs/reference/inference/put-inference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ creating the {infer} model, you cannot change the associated API key. If you
want to use a different API key, delete the {infer} model and recreate it with
the same name and the updated API key.
`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. Refer to the
Expand Down Expand Up @@ -506,8 +512,8 @@ been
[[inference-example-openai]]
===== OpenAI service

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 @@ -516,7 +522,8 @@ 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
}
}
------------------------------------------------------------
Expand Down

0 comments on commit d50fa37

Please sign in to comment.