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-1325: update response for inference-runs #21

Merged
merged 8 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions fern/openapi/overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,43 @@ paths:
- 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"
x-fern-sdk-group-name:
- prompts
- runs
x-fern-sdk-method-name: list
x-fern-audiences:
- public
post:
$ref: "./resources/prompts.yaml#/paths/~1api~1prompts~1{id}~1versions~1{version_id}~1inference-runs/post"
x-fern-sdk-group-name:
- prompts
- versions
x-fern-sdk-method-name: create_run
- runs
x-fern-sdk-method-name: create
x-fern-audiences:
- public

/api/inference-runs/{pk}/indicators:
matt-bernstein marked this conversation as resolved.
Show resolved Hide resolved
get:
$ref: "./resources/prompts.yaml#/paths/~1api~1inference-runs~1{pk}~1indicators/get"
x-fern-sdk-group-name:
- prompts
- indicators
x-fern-sdk-method-name: list
x-fern-audiences:
- public

/api/inference-runs/{pk}/indicators/{indicator_key}:
get:
$ref: "./resources/prompts.yaml#/paths/~1api~1inference-runs~1{pk}~1indicators~1{indicator_key}/get"
x-fern-sdk-group-name:
- prompts
- indicators
x-fern-sdk-method-name: get
x-fern-audiences:
- public

/api/model-provider-connections/:
post:
$ref: "./resources/prompts.yaml#/paths/~1api~1model-provider-connections/post"
Expand Down
67 changes: 67 additions & 0 deletions fern/openapi/resources/dashboards.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
components:
schemas:
KeyIndicators:
title: Scores and metadata
type: array
items:
type: object
required:
- key
- title
- main_kpi
properties:
key:
title: Indicator key
description: The key for this KPI, where you can find the value from inside main_kpi
type: string
title:
title: Metric title
description: The title for this metric, to be displayed to the user
type: string
main_kpi:
title: The primary KPI, displayed in the top left of the box
type: string
secondary_kpi:
title: The secondary KPI, displayed in the top right of the box
type: string
additional_kpis:
title: Additional KPIs
description: Additional KPIs to be displayed at the bottom of the box
type: array
items:
type: object
properties:
key:
title: Indicator key
description: The key for this KPI, where you can find the value from inside main_kpi
type: string
label:
title: Label
description: The label for this KPI, to be displayed to the user
type: string
extra_kpis:
title: Extra KPIs
description: Extra KPIs to be displayed in the hover-tootip for that indicator
type: array
items:
type: object
properties:
key:
title: Indicator key
description: The key for this KPI, where you can find the value from inside main_kpi
type: string
label:
title: Label
description: The label for this KPI, to be displayed to the user
type: string

KeyIndicatorValue:
title: Key Indicator Value
type: object
properties:
title:
title: Key Indicator Title
type: string
values:
title: Key Indicator Values
type: object
132 changes: 102 additions & 30 deletions fern/openapi/resources/prompts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ paths:
get:
summary: List prompts
description: >
Get a list of prompts.
Get a list of prompts.
responses:
"200":
description: ""
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Prompt"
"200":
description: ""
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Prompt"
post:
summary: Create prompt
description: >
Create a new prompt.
Create a new prompt.
requestBody:
content:
application/json:
Expand All @@ -34,7 +34,7 @@ paths:
post:
summary: Create prompt version
description: >
Create a new version of a prompt.
Create a new version of a prompt.
parameters:
- name: id
in: path
Expand All @@ -60,7 +60,7 @@ paths:
post:
summary: Run prompt inference
description: >
Run a prompt inference.
Run a prompt inference.
parameters:
- name: id
in: path
Expand All @@ -86,12 +86,97 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/InferenceRun"
get:
summary: Get inference run info
description: >-
Get information (status, etadata, etc) about an existing inference run
parameters:
- name: id
in: path
description: Prompt ID
required: true
schema:
type: integer
- name: version_id
in: path
description: Prompt Version ID
required: true
schema:
type: integer
- name: project
in: query
description: The ID of the project that this Interence Run makes predictions on
required: true
schema:
type: integer
- name: project_subset
in: query
description: >
Defines which tasks are operated on
(e.g. HasGT will only operate on tasks with a ground truth annotation, but All will operate on all records)
required: true
schema:
type: string
enum: [All, HasGT, Sample]
responses:
"200":
description: "Success"
content:
application/json:
schema:
$ref: "#/components/schemas/InferenceRun"

/api/inference-runs/{pk}/indicators:
get:
summary: Get key indicators
description: >
Get key indicators for the Prompt dashboard.
parameters:
- name: pk
in: path
description: Inference run ID
required: true
schema:
type: integer
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: "./dashboards.yaml#/components/schemas/KeyIndicators"

/api/inference-runs/{pk}/indicators/{indicator_key}:
get:
summary: Get key indicator
description: >
Get a specific key indicator for the Prompt dashboard.
parameters:
- name: indicator_key
in: path
description: Key of the indicator
required: true
schema:
type: string
- name: pk
in: path
description: Inference run ID
required: true
schema:
type: integer
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: "./dashboards.yaml#/components/schemas/KeyIndicatorValue"

/api/model-provider-connections:
post:
summary: Create model provider connection
description: >
Create a new model provider connection.
Create a new model provider connection.
requestBody:
content:
application/json:
Expand All @@ -103,16 +188,15 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/ModelProviderConnection"

$ref: "#/components/schemas/ModelProviderConnection"

/api/model-run/batch-predictions:
post:
summary: Create batch predictions
description: >
Create a new batch prediction.
Create a new batch prediction.
requestBody:
$ref: "#/components/requestBodies/api_prompts_batch_predictions_create"
$ref: "#/components/requestBodies/api_prompts_batch_predictions_create"
responses:
"201":
description: ""
Expand Down Expand Up @@ -284,18 +368,6 @@ components:
title: Job ID
type: string
nullable: true
total_predictions:
title: Total Predictions
type: integer
readOnly: true
total_correct_predictions:
title: Total Correct Predictions
type: integer
readOnly: true
total_tasks:
title: Total Tasks
type: integer
readOnly: true
created_at:
title: Created at
type: string
Expand All @@ -319,6 +391,7 @@ components:
format: date-time
nullable: true
readOnly: true

ModelProviderConnection:
required:
- provider
Expand Down Expand Up @@ -373,7 +446,6 @@ components:
readOnly: true

requestBodies:

api_prompts_batch_predictions_create:
content:
application/json:
Expand Down