File tree Expand file tree Collapse file tree 3 files changed +93
-46
lines changed
x-pack/plugin/inference/src/yamlRestTest/resources/rest-api-spec/test/inference Expand file tree Collapse file tree 3 files changed +93
-46
lines changed Original file line number Diff line number Diff line change @@ -1176,3 +1176,50 @@ setup:
11761176 - exists : hits.hits.0._source._inference_fields.sparse_field.inference.chunks.sparse_field.1.embeddings
11771177 - match : { hits.hits.0._source._inference_fields.sparse_field.inference.chunks.sparse_field.1.start_offset: 20 }
11781178 - match : { hits.hits.0._source._inference_fields.sparse_field.inference.chunks.sparse_field.1.end_offset: 35 }
1179+
1180+ ---
1181+ " inference endpoint late creation " :
1182+ - do :
1183+ indices.create :
1184+ index : new-index
1185+ body :
1186+ mappings :
1187+ properties :
1188+ inference_field :
1189+ type : semantic_text
1190+ inference_id : new_inference_endpoint
1191+
1192+ - do :
1193+ inference.put :
1194+ task_type : sparse_embedding
1195+ inference_id : new_inference_endpoint
1196+ body : >
1197+ {
1198+ "service": "test_service",
1199+ "service_settings": {
1200+ "model": "my_model",
1201+ "api_key": "abc64"
1202+ },
1203+ "task_settings": {
1204+ }
1205+ }
1206+
1207+
1208+ - do :
1209+ index :
1210+ index : new-index
1211+ id : doc_1
1212+ body :
1213+ inference_field : " inference test"
1214+ refresh : true
1215+
1216+ - do :
1217+ search :
1218+ index : new-index
1219+ body :
1220+ query :
1221+ exists :
1222+ field : " inference_field"
1223+
1224+ - match : { hits.total.value: 1 }
1225+
Original file line number Diff line number Diff line change @@ -739,3 +739,49 @@ setup:
739739 - exists : hits.hits.0._source.sparse_field.inference.chunks.0.embeddings
740740 - match : { hits.hits.0._source.sparse_field.inference.chunks.1.text: "now with chunks" }
741741 - exists : hits.hits.0._source.sparse_field.inference.chunks.1.embeddings
742+
743+ ---
744+ " inference endpoint late creation " :
745+ - do :
746+ indices.create :
747+ index : new-index
748+ body :
749+ mappings :
750+ properties :
751+ inference_field :
752+ type : semantic_text
753+ inference_id : new_inference_endpoint
754+
755+ - do :
756+ inference.put :
757+ task_type : sparse_embedding
758+ inference_id : new_inference_endpoint
759+ body : >
760+ {
761+ "service": "test_service",
762+ "service_settings": {
763+ "model": "my_model",
764+ "api_key": "abc64"
765+ },
766+ "task_settings": {
767+ }
768+ }
769+
770+
771+ - do :
772+ index :
773+ index : new-index
774+ id : doc_1
775+ body :
776+ inference_field : " inference test"
777+ refresh : true
778+
779+ - do :
780+ search :
781+ index : new-index
782+ body :
783+ query :
784+ exists :
785+ field : " inference_field"
786+
787+ - match : { hits.total.value: 1 }
Original file line number Diff line number Diff line change @@ -190,49 +190,3 @@ setup:
190190 - match : { error.caused_by.reason: "Field [inference_field] expected query inference results with 10 dimensions, got
191191 20 dimensions. Has the configuration for inference endpoint [dense-inference-id]
192192 changed?" }
193-
194- ---
195- " inference endpoint late creation " :
196- - do :
197- indices.create :
198- index : new-index
199- body :
200- mappings :
201- properties :
202- inference_field :
203- type : semantic_text
204- inference_id : new_inference_endpoint
205-
206- - do :
207- inference.put :
208- task_type : sparse_embedding
209- inference_id : new_inference_endpoint
210- body : >
211- {
212- "service": "test_service",
213- "service_settings": {
214- "model": "my_model",
215- "api_key": "abc64"
216- },
217- "task_settings": {
218- }
219- }
220-
221-
222- - do :
223- index :
224- index : new-index
225- id : doc_1
226- body :
227- inference_field : " inference test"
228- refresh : true
229-
230- - do :
231- search :
232- index : new-index
233- body :
234- query :
235- exists :
236- field : " inference_field"
237-
238- - match : { hits.total.value: 1 }
You can’t perform that action at this time.
0 commit comments