Skip to content

Commit

Permalink
[DOCS] Documents dimensions param for openai service of Inference…
Browse files Browse the repository at this point in the history
… API (#118317)

Co-authored-by: David Kyle <[email protected]>
  • Loading branch information
szabosteve and davidkyle committed Dec 10, 2024
1 parent 4ce4186 commit 20eef1a
Showing 1 changed file with 11 additions and 5 deletions.
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

0 comments on commit 20eef1a

Please sign in to comment.