@@ -319,6 +319,37 @@ paths:
319
319
$ref : " #/components/schemas/InferenceRun"
320
320
321
321
/api/prompts/{prompt_id}/versions/{version_id}/refine :
322
+ get :
323
+ summary : Get refined prompt
324
+ description : >
325
+ Get the refined prompt based on the `refinement_job_id`.
326
+ parameters :
327
+ - name : prompt_id
328
+ in : path
329
+ description : Prompt ID
330
+ required : true
331
+ schema :
332
+ type : integer
333
+ - name : version_id
334
+ in : path
335
+ description : Prompt Version ID
336
+ required : true
337
+ schema :
338
+ type : integer
339
+ - name : refinement_job_id
340
+ in : query
341
+ description : Refinement Job ID acquired from the `POST /api/prompts/{prompt_id}/versions/{version_id}/refine` endpoint
342
+ required : true
343
+ schema :
344
+ type : string
345
+ responses :
346
+ " 200 " :
347
+ description : " "
348
+ content :
349
+ application/json :
350
+ schema :
351
+ $ref : " #/components/schemas/RefinedPromptResponse"
352
+
322
353
post :
323
354
summary : Refine a prompt version
324
355
description : >
@@ -336,6 +367,12 @@ paths:
336
367
required : true
337
368
schema :
338
369
type : integer
370
+ - name : async
371
+ in : query
372
+ description : Run the refinement job asynchronously
373
+ required : false
374
+ schema :
375
+ type : boolean
339
376
requestBody :
340
377
$ref : " #/components/requestBodies/api_prompts_versions_refine_prompt_create"
341
378
responses :
@@ -344,7 +381,8 @@ paths:
344
381
content :
345
382
application/json :
346
383
schema :
347
- $ref : " #/components/schemas/PromptVersion"
384
+ $ref : " #/components/schemas/RefinedPromptResponse"
385
+
348
386
/api/inference-runs/{pk}/indicators :
349
387
get :
350
388
summary : Get key indicators
@@ -709,6 +747,40 @@ components:
709
747
description : Total cost of the inference (in USD)
710
748
nullable : true
711
749
750
+ RefinedPromptResponse :
751
+ type : object
752
+ properties :
753
+ title :
754
+ type : string
755
+ title : Title
756
+ description : Title of the refined prompt
757
+ reasoning :
758
+ type : string
759
+ title : Reasoning
760
+ description : Reasoning behind the refinement
761
+ prompt :
762
+ type : string
763
+ title : Prompt
764
+ description : The refined prompt text
765
+ refinement_job_id :
766
+ type : string
767
+ title : Refinement Job ID
768
+ description : Unique identifier for the refinement job
769
+ readOnly : true
770
+ refinement_status :
771
+ type : string
772
+ title : Refinement Status
773
+ description : Status of the refinement job
774
+ enum :
775
+ - Pending
776
+ - InProgress
777
+ - Completed
778
+ - Failed
779
+ readOnly : true
780
+ default : Pending
781
+ required :
782
+ - prompt
783
+
712
784
requestBodies :
713
785
api_prompts_batch_predictions_create :
714
786
content :
0 commit comments