File tree Expand file tree Collapse file tree 6 files changed +1
-62
lines changed Expand file tree Collapse file tree 6 files changed +1
-62
lines changed Original file line number Diff line number Diff line change @@ -1170,6 +1170,7 @@ async def rerank(
1170
1170
:returns: RerankResponse with indices sorted by relevance score (descending).
1171
1171
"""
1172
1172
raise NotImplementedError ("Reranking is not implemented" )
1173
+ return # this is so mypy's safe-super rule will consider the method concrete
1173
1174
1174
1175
@webmethod (route = "/openai/v1/completions" , method = "POST" )
1175
1176
async def openai_completion (
Original file line number Diff line number Diff line change 33
33
InterleavedContent ,
34
34
LogProbConfig ,
35
35
Message ,
36
- OpenAIChatCompletionContentPartImageParam ,
37
- OpenAIChatCompletionContentPartTextParam ,
38
- RerankResponse ,
39
36
ResponseFormat ,
40
37
SamplingParams ,
41
38
StopReason ,
@@ -445,15 +442,6 @@ async def batch_chat_completion(
445
442
results = await self ._nonstream_chat_completion (request_batch )
446
443
return BatchChatCompletionResponse (batch = results )
447
444
448
- async def rerank (
449
- self ,
450
- model : str ,
451
- query : str | OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam ,
452
- items : list [str | OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam ],
453
- max_num_results : int | None = None ,
454
- ) -> RerankResponse :
455
- raise NotImplementedError ("Reranking is not supported for Meta Reference" )
456
-
457
445
async def _nonstream_chat_completion (
458
446
self , request_batch : list [ChatCompletionRequest ]
459
447
) -> list [ChatCompletionResponse ]:
Original file line number Diff line number Diff line change 12
12
InterleavedContent ,
13
13
LogProbConfig ,
14
14
Message ,
15
- OpenAIChatCompletionContentPartImageParam ,
16
- OpenAIChatCompletionContentPartTextParam ,
17
- RerankResponse ,
18
15
ResponseFormat ,
19
16
SamplingParams ,
20
17
ToolChoice ,
@@ -125,12 +122,3 @@ async def batch_chat_completion(
125
122
logprobs : LogProbConfig | None = None ,
126
123
):
127
124
raise NotImplementedError ("Batch chat completion is not supported for Sentence Transformers" )
128
-
129
- async def rerank (
130
- self ,
131
- model : str ,
132
- query : str | OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam ,
133
- items : list [str | OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam ],
134
- max_num_results : int | None = None ,
135
- ) -> RerankResponse :
136
- raise NotImplementedError ("Reranking is not supported for Sentence Transformers" )
Original file line number Diff line number Diff line change 3
3
#
4
4
# This source code is licensed under the terms described in the LICENSE file in
5
5
# the root directory of this source tree.
6
- from llama_stack .apis .inference import (
7
- OpenAIChatCompletionContentPartImageParam ,
8
- OpenAIChatCompletionContentPartTextParam ,
9
- RerankResponse ,
10
- )
11
6
from llama_stack .log import get_logger
12
7
from llama_stack .providers .remote .inference .llama_openai_compat .config import LlamaCompatConfig
13
8
from llama_stack .providers .utils .inference .litellm_openai_mixin import LiteLLMOpenAIMixin
@@ -59,12 +54,3 @@ async def initialize(self):
59
54
60
55
async def shutdown (self ):
61
56
await super ().shutdown ()
62
-
63
- async def rerank (
64
- self ,
65
- model : str ,
66
- query : str | OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam ,
67
- items : list [str | OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam ],
68
- max_num_results : int | None = None ,
69
- ) -> RerankResponse :
70
- raise NotImplementedError ("Reranking is not supported for Llama OpenAI Compat" )
Original file line number Diff line number Diff line change 37
37
Message ,
38
38
OpenAIChatCompletion ,
39
39
OpenAIChatCompletionChunk ,
40
- OpenAIChatCompletionContentPartImageParam ,
41
- OpenAIChatCompletionContentPartTextParam ,
42
40
OpenAICompletion ,
43
41
OpenAIEmbeddingsResponse ,
44
42
OpenAIEmbeddingUsage ,
45
43
OpenAIMessageParam ,
46
44
OpenAIResponseFormatParam ,
47
- RerankResponse ,
48
45
ResponseFormat ,
49
46
SamplingParams ,
50
47
TextTruncation ,
@@ -644,15 +641,6 @@ async def batch_chat_completion(
644
641
):
645
642
raise NotImplementedError ("Batch chat completion is not supported for Ollama" )
646
643
647
- async def rerank (
648
- self ,
649
- model : str ,
650
- query : str | OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam ,
651
- items : list [str | OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam ],
652
- max_num_results : int | None = None ,
653
- ) -> RerankResponse :
654
- raise NotImplementedError ("Reranking is not supported for Ollama" )
655
-
656
644
657
645
async def convert_message_to_openai_dict_for_ollama (message : Message ) -> list [dict ]:
658
646
async def _convert_content (content ) -> dict :
Original file line number Diff line number Diff line change 39
39
Message ,
40
40
ModelStore ,
41
41
OpenAIChatCompletion ,
42
- OpenAIChatCompletionContentPartImageParam ,
43
- OpenAIChatCompletionContentPartTextParam ,
44
42
OpenAICompletion ,
45
43
OpenAIEmbeddingData ,
46
44
OpenAIEmbeddingsResponse ,
47
45
OpenAIEmbeddingUsage ,
48
46
OpenAIMessageParam ,
49
47
OpenAIResponseFormatParam ,
50
- RerankResponse ,
51
48
ResponseFormat ,
52
49
SamplingParams ,
53
50
TextTruncation ,
@@ -736,12 +733,3 @@ async def batch_chat_completion(
736
733
logprobs : LogProbConfig | None = None ,
737
734
):
738
735
raise NotImplementedError ("Batch chat completion is not supported for vLLM" )
739
-
740
- async def rerank (
741
- self ,
742
- model : str ,
743
- query : str | OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam ,
744
- items : list [str | OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam ],
745
- max_num_results : int | None = None ,
746
- ) -> RerankResponse :
747
- raise NotImplementedError ("Reranking is not supported for vLLM" )
You can’t perform that action at this time.
0 commit comments