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: openapi.yaml
+178-2Lines changed: 178 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -509,7 +509,61 @@ paths:
509
509
description: Invalid request parameters.
510
510
'404':
511
511
description: Fine-tune ID not found.
512
-
512
+
/rerank:
513
+
post:
514
+
tags: ['Rerank']
515
+
summary: Create a rerank request
516
+
description: Query a reranker model
517
+
operationId: rerank
518
+
requestBody:
519
+
content:
520
+
application/json:
521
+
schema:
522
+
$ref: '#/components/schemas/RerankRequest'
523
+
responses:
524
+
'200':
525
+
description: '200'
526
+
content:
527
+
application/json:
528
+
schema:
529
+
$ref: '#/components/schemas/RerankResponse'
530
+
'400':
531
+
description: 'BadRequest'
532
+
content:
533
+
application/json:
534
+
schema:
535
+
$ref: '#/components/schemas/ErrorData'
536
+
'401':
537
+
description: 'Unauthorized'
538
+
content:
539
+
application/json:
540
+
schema:
541
+
$ref: '#/components/schemas/ErrorData'
542
+
'404':
543
+
description: 'NotFound'
544
+
content:
545
+
application/json:
546
+
schema:
547
+
$ref: '#/components/schemas/ErrorData'
548
+
'429':
549
+
description: 'RateLimit'
550
+
content:
551
+
application/json:
552
+
schema:
553
+
$ref: '#/components/schemas/ErrorData'
554
+
'503':
555
+
description: 'Overloaded'
556
+
content:
557
+
application/json:
558
+
schema:
559
+
$ref: '#/components/schemas/ErrorData'
560
+
'504':
561
+
description: 'Timeout'
562
+
content:
563
+
application/json:
564
+
schema:
565
+
$ref: '#/components/schemas/ErrorData'
566
+
deprecated: false
513
567
components:
514
568
securitySchemes:
515
569
bearerAuth:
@@ -519,6 +573,128 @@ components:
519
573
x-default: default
520
574
521
575
schemas:
576
+
RerankRequest:
577
+
type: object
578
+
properties:
579
+
model:
580
+
type: string
581
+
description: The model to be used for the rerank request.
582
+
example: Salesforce/Llama-Rank-V1
583
+
query:
584
+
type: string
585
+
description: The search query to be used for ranking.
586
+
example: 'What animals can I find near Peru?'
587
+
documents:
588
+
description: List of documents, which can be either strings or objects.
589
+
oneOf:
590
+
- type: array
591
+
items:
592
+
type: object
593
+
additionalProperties: true
594
+
- type: array
595
+
items:
596
+
type: string
597
+
example: Our solar system orbits the Milky Way galaxy at about 515,000 mph
598
+
example:
599
+
- {
600
+
'title': 'Llama',
601
+
'text': 'The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era.',
602
+
}
603
+
- {
604
+
'title': 'Panda',
605
+
'text': 'The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China.',
606
+
}
607
+
- {
608
+
'title': 'Guanaco',
609
+
'text': 'The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations.',
610
+
}
611
+
- {
612
+
'title': 'Wild Bactrian camel',
613
+
'text': 'The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia.',
614
+
}
615
+
top_n:
616
+
type: integer
617
+
description: The number of top results to return.
618
+
example: 2
619
+
return_documents:
620
+
type: boolean
621
+
description: Whether to return supplied documents with the response.
622
+
example: true
623
+
rank_fields:
624
+
type: array
625
+
items:
626
+
type: string
627
+
description: List of keys in the JSON Object document to rank by. Defaults to use all supplied keys for ranking.
628
+
example: ['title', 'text']
629
+
required:
630
+
- model
631
+
- query
632
+
- documents
633
+
additionalProperties: false
634
+
635
+
RerankResponse:
636
+
type: object
637
+
required:
638
+
- object
639
+
- model
640
+
- results
641
+
properties:
642
+
object:
643
+
type: string
644
+
description: Object type
645
+
enum:
646
+
- rerank
647
+
example: rerank
648
+
id:
649
+
type: string
650
+
description: Request ID
651
+
example: 9dfa1a09-5ebc-4a40-970f-586cb8f4ae47
652
+
model:
653
+
type: string
654
+
description: The model to be used for the rerank request.
655
+
example: salesforce/turboranker-0.8-3778-6328
656
+
results:
657
+
type: array
658
+
items:
659
+
type: object
660
+
required: [index, relevance_score, document]
661
+
properties:
662
+
index:
663
+
type: integer
664
+
relevance_score:
665
+
type: number
666
+
document:
667
+
type: object
668
+
properties:
669
+
text:
670
+
type: string
671
+
nullable: true
672
+
example:
673
+
- {
674
+
'index': 0,
675
+
'relevance_score': 0.29980177813003117,
676
+
'document':
677
+
{
678
+
'text': '{"title":"Llama","text":"The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era."}',
679
+
},
680
+
}
681
+
- {
682
+
'index': 2,
683
+
'relevance_score': 0.2752447527354349,
684
+
'document':
685
+
{
686
+
'text': '{"title":"Guanaco","text":"The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations."}',
0 commit comments