@@ -31,7 +31,10 @@ async def delete_model(
31
31
* ,
32
32
inference_id : str ,
33
33
task_type : t .Optional [
34
- t .Union ["t.Literal['sparse_embedding', 'text_embedding']" , str ]
34
+ t .Union [
35
+ "t.Literal['completion', 'rerank', 'sparse_embedding', 'text_embedding']" ,
36
+ str ,
37
+ ]
35
38
] = None ,
36
39
error_trace : t .Optional [bool ] = None ,
37
40
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
@@ -85,7 +88,10 @@ async def get_model(
85
88
* ,
86
89
inference_id : str ,
87
90
task_type : t .Optional [
88
- t .Union ["t.Literal['sparse_embedding', 'text_embedding']" , str ]
91
+ t .Union [
92
+ "t.Literal['completion', 'rerank', 'sparse_embedding', 'text_embedding']" ,
93
+ str ,
94
+ ]
89
95
] = None ,
90
96
error_trace : t .Optional [bool ] = None ,
91
97
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
@@ -134,20 +140,24 @@ async def get_model(
134
140
)
135
141
136
142
@_rewrite_parameters (
137
- body_fields = ("input" , "task_settings" ),
143
+ body_fields = ("input" , "query" , " task_settings" ),
138
144
)
139
145
async def inference (
140
146
self ,
141
147
* ,
142
148
inference_id : str ,
143
149
input : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
144
150
task_type : t .Optional [
145
- t .Union ["t.Literal['sparse_embedding', 'text_embedding']" , str ]
151
+ t .Union [
152
+ "t.Literal['completion', 'rerank', 'sparse_embedding', 'text_embedding']" ,
153
+ str ,
154
+ ]
146
155
] = None ,
147
156
error_trace : t .Optional [bool ] = None ,
148
157
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
149
158
human : t .Optional [bool ] = None ,
150
159
pretty : t .Optional [bool ] = None ,
160
+ query : t .Optional [str ] = None ,
151
161
task_settings : t .Optional [t .Any ] = None ,
152
162
body : t .Optional [t .Dict [str , t .Any ]] = None ,
153
163
) -> ObjectApiResponse [t .Any ]:
@@ -159,6 +169,7 @@ async def inference(
159
169
:param inference_id: The inference Id
160
170
:param input: Text input to the model. Either a string or an array of strings.
161
171
:param task_type: The task type
172
+ :param query: Query input, required for rerank task. Not required for other tasks.
162
173
:param task_settings: Optional task settings
163
174
"""
164
175
if inference_id in SKIP_IN_PATH :
@@ -190,6 +201,8 @@ async def inference(
190
201
if not __body :
191
202
if input is not None :
192
203
__body ["input" ] = input
204
+ if query is not None :
205
+ __body ["query" ] = query
193
206
if task_settings is not None :
194
207
__body ["task_settings" ] = task_settings
195
208
if not __body :
@@ -217,7 +230,10 @@ async def put_model(
217
230
model_config : t .Optional [t .Mapping [str , t .Any ]] = None ,
218
231
body : t .Optional [t .Mapping [str , t .Any ]] = None ,
219
232
task_type : t .Optional [
220
- t .Union ["t.Literal['sparse_embedding', 'text_embedding']" , str ]
233
+ t .Union [
234
+ "t.Literal['completion', 'rerank', 'sparse_embedding', 'text_embedding']" ,
235
+ str ,
236
+ ]
221
237
] = None ,
222
238
error_trace : t .Optional [bool ] = None ,
223
239
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
0 commit comments