Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: DIA-1402: V1-Submit Prompt auto-refinement job #27

Merged
merged 12 commits into from
Oct 1, 2024
10 changes: 10 additions & 0 deletions fern/openapi/overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ paths:
x-fern-audiences:
- public

/api/prompts/{prompt_id}/versions/{version_id}/refine:
post:
$ref: "./resources/prompts.yaml#/paths/~1api~1prompts~1{prompt_id}~1versions~1{version_id}~1refine/post"
x-fern-sdk-group-name:
- prompts
- versions
x-fern-sdk-method-name: refine_prompt
x-fern-audiences:
- public

/api/prompts/{id}/versions/{version_id}/inference-runs:
get:
$ref: "./resources/prompts.yaml#/paths/~1api~1prompts~1{id}~1versions~1{version_id}~1inference-runs/get"
Expand Down
47 changes: 47 additions & 0 deletions fern/openapi/resources/prompts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,33 @@ paths:
schema:
$ref: "#/components/schemas/InferenceRun"

/api/prompts/{prompt_id}/versions/{version_id}/refine:
post:
summary: Refine a prompt version
description: >
Refine a prompt version using a teacher model and save the refined prompt as a new version.
parameters:
- name: prompt_id
in: path
description: Prompt ID
required: true
schema:
type: integer
- name: version_id
in: path
description: Base Prompt Version ID
required: true
schema:
type: integer
requestBody:
$ref: "#/components/requestBodies/api_prompts_versions_refine_prompt_create"
responses:
"201":
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/PromptVersion"
/api/inference-runs/{pk}/indicators:
get:
summary: Get key indicators
Expand Down Expand Up @@ -726,3 +753,23 @@ components:
description: Error message details
additionalProperties:
nullable: true
api_prompts_versions_refine_prompt_create:
content:
application/json:
schema:
type: object
properties: # TODO need to add model version from url here?
teacher_model_provider_connection_id:
title: Teacher Model Provider Connection ID
description: Model Provider Connection ID to use to refine the prompt
type: integer
teacher_model_name:
title: Teacher Model Name
description: Name of the model to use to refine the prompt
type: string
additionalProperties:
nullable: true
project_id:
title: Project ID
description: Project ID to target the refined prompt for
type: integer