Text Embeddings Inference

Get Sentence Similarity. Returns a 424 status code if the model is not an embedding model.

post/similarity

Request body

Example request

{
  "inputs": {
    "sentences": [
      "What is Machine Learning?"
    ],
    "source_sentence": "What is Deep Learning?"
  },
  "parameters": {
    "prompt_name": "null"
  }
}

Response

Sentence Similarity

number[] required

Example response

[
  0,
  1,
  0.5
]

Changes

Changed in 3 of the 42 revisions of this API.143

    • added the new Empty enum value to the error_type response property for the response status 413

      response-property-enum-value-added

    • added the new Empty enum value to the error_type response property for the response status 422

      response-property-enum-value-added

    • added the new Empty enum value to the error_type response property for the response status 424

      response-property-enum-value-added

    • added the new Empty enum value to the error_type response property for the response status 429

      response-property-enum-value-added

    • the request property parameters/allOf[SimilarityParameters]/truncation_direction became optional

      request-property-became-optional

    • added the non-success response with the status 400

      response-non-success-status-added

    • endpoint added

      endpoint-added

    • api path removed without deprecation

      api-path-removed-without-deprecation

    This revision also has 30 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog