You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/openapi.json
+172Lines changed: 172 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -565,6 +565,93 @@
565
565
}
566
566
}
567
567
},
568
+
"/similarity": {
569
+
"post": {
570
+
"tags": [
571
+
"Text Embeddings Inference"
572
+
],
573
+
"summary": "Get Sentence Similarity. Returns a 424 status code if the model is not an embedding model.",
574
+
"operationId": "similarity",
575
+
"requestBody": {
576
+
"content": {
577
+
"application/json": {
578
+
"schema": {
579
+
"$ref": "#/components/schemas/SimilarityRequest"
580
+
}
581
+
}
582
+
},
583
+
"required": true
584
+
},
585
+
"responses": {
586
+
"200": {
587
+
"description": "Sentence Similarity",
588
+
"content": {
589
+
"application/json": {
590
+
"schema": {
591
+
"$ref": "#/components/schemas/SimilarityResponse"
592
+
}
593
+
}
594
+
}
595
+
},
596
+
"413": {
597
+
"description": "Batch size error",
598
+
"content": {
599
+
"application/json": {
600
+
"schema": {
601
+
"$ref": "#/components/schemas/ErrorResponse"
602
+
},
603
+
"example": {
604
+
"error": "Batch size error",
605
+
"error_type": "validation"
606
+
}
607
+
}
608
+
}
609
+
},
610
+
"422": {
611
+
"description": "Tokenization error",
612
+
"content": {
613
+
"application/json": {
614
+
"schema": {
615
+
"$ref": "#/components/schemas/ErrorResponse"
616
+
},
617
+
"example": {
618
+
"error": "Tokenization error",
619
+
"error_type": "tokenizer"
620
+
}
621
+
}
622
+
}
623
+
},
624
+
"424": {
625
+
"description": "Embedding Error",
626
+
"content": {
627
+
"application/json": {
628
+
"schema": {
629
+
"$ref": "#/components/schemas/ErrorResponse"
630
+
},
631
+
"example": {
632
+
"error": "Inference failed",
633
+
"error_type": "backend"
634
+
}
635
+
}
636
+
}
637
+
},
638
+
"429": {
639
+
"description": "Model is overloaded",
640
+
"content": {
641
+
"application/json": {
642
+
"schema": {
643
+
"$ref": "#/components/schemas/ErrorResponse"
644
+
},
645
+
"example": {
646
+
"error": "Model is overloaded",
647
+
"error_type": "overloaded"
648
+
}
649
+
}
650
+
}
651
+
}
652
+
}
653
+
}
654
+
},
568
655
"/tokenize": {
569
656
"post": {
570
657
"tags": [
@@ -1441,6 +1528,91 @@
1441
1528
"$ref": "#/components/schemas/Rank"
1442
1529
}
1443
1530
},
1531
+
"SimilarityInput": {
1532
+
"type": "object",
1533
+
"required": [
1534
+
"source_sentence",
1535
+
"sentences"
1536
+
],
1537
+
"properties": {
1538
+
"sentences": {
1539
+
"type": "array",
1540
+
"items": {
1541
+
"type": "string"
1542
+
},
1543
+
"description": "A list of strings which will be compared against the source_sentence.",
1544
+
"example": [
1545
+
"What is Machine Learning?"
1546
+
]
1547
+
},
1548
+
"source_sentence": {
1549
+
"type": "string",
1550
+
"description": "The string that you wish to compare the other strings with. This can be a phrase, sentence,\nor longer passage, depending on the model being used.",
1551
+
"example": "What is Deep Learning?"
1552
+
}
1553
+
}
1554
+
},
1555
+
"SimilarityParameters": {
1556
+
"type": "object",
1557
+
"required": [
1558
+
"truncation_direction"
1559
+
],
1560
+
"properties": {
1561
+
"prompt_name": {
1562
+
"type": "string",
1563
+
"description": "The name of the prompt that should be used by for encoding. If not set, no prompt\nwill be applied.\n\nMust be a key in the `Sentence Transformers` configuration `prompts` dictionary.\n\nFor example if ``prompt_name`` is \"query\" and the ``prompts`` is {\"query\": \"query: \", ...},\nthen the sentence \"What is the capital of France?\" will be encoded as\n\"query: What is the capital of France?\" because the prompt text will be prepended before\nany text to encode.",
0 commit comments