Query parameters
-
Specifies the amount of time to wait for the inference request to complete.
Values are
-1or0.External documentation
Body
Required
input
string | array[string] | object | array[object] Inference input. Either a string, an array of strings, a
contentobject, or an array ofcontentobjects.string example:
"input": "Some text"string array example:
"input": ["Some text", "Some more text"]contentobject example:"input": { "content": { "type": "image", "format": "base64", "value": "data:image/jpeg;base64,..." } }contentobject array example:"input": [ { "content": { "type": "text", "format": "text", "value": "Some text to generate an embedding" } }, { "content": { "type": "image", "format": "base64", "value": "data:image/jpeg;base64,..." } } ]-
The input data type for the embedding model. Possible values include:
SEARCHINGESTCLASSIFICATIONCLUSTERING
Not all models support all values. Unsupported values will trigger a validation exception. Accepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info.
The
input_typeparameter specified on the root level of the request body will take precedence over theinput_typeparameter specified intask_settings. -
Task settings for the individual inference request. These settings are specific to the you specified and override the task settings specified when initializing the service.
curl \
--request POST 'http://api.example.com/_inference/embedding/{inference_id}' \
--header "Content-Type: application/json" \
--data '"{\n \"input\": [\n {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n }\n },\n {\n \"content\": {\n \"type\": \"text\",\n \"value\": \"Some text to create an embedding\"\n }\n }\n ]\n}"'
{
"input": [
{
"content": {
"type": "image",
"format": "base64",
"value": "data:image/jpeg;base64,..."
}
},
{
"content": {
"type": "text",
"value": "Some text to create an embedding"
}
}
]
}
{
"input": ["The first text", "The second text"]
}
{
"embeddings": [
{
"embedding": [
-0.0189209,
-0.04174805,
0.00854492,
0.01556396,
0.01928711,
-0.00616455,
-0.00460815,
0.01477051,
-0.00656128,
0.05419922
]
},
{
"embedding": [
-0.01379395,
-0.02368164,
0.01068115,
0.0279541,
0.01043701,
-7.7057E-4,
0.04150391,
0.00836182,
-0.01135254,
0.0246582
]
}
]
}
{
"embeddings": [
{
"embedding": [
0.00854492,
-0.00616455,
-0.0189209,
0.01556396,
-0.00460815,
0.01477051,
-0.04174805,
0.01928711,
-0.00656128,
0.05419922
]
},
{
"embedding": [
-0.01135254,
0.0279541,
-0.02368164,
0.01068115,
0.01043701,
0.04150391,
0.00836182,
-7.7057E-4,
-0.01379395,
0.0246582
]
}
]
}