-
-
Notifications
You must be signed in to change notification settings - Fork 469
Description
Problem
Here is the existing REST API interface:
export type GetModelParametersResponse = {
parameters: Record<string, ParameterSchema>;
parameter_names: string[];
count: number;
};
export type ParameterSchema = {
type: 'boolean' | 'integer' | 'number' | 'string' | 'array' | 'object';
description: string;
min?: number;
max?: number;
};
export type UpdateModelParametersResponse = {
status: string;
message: string;
model_id: string;
parameters: Record<string, any>;
};
There are a couple of issues:
-
UpdateModelParametersResponseis totally unused by the frontend. Theparametersproperty is the same as the request object. Themodel_idis already known by the frontend, and bothstatusandmessageare unnecessary as HTTP status codes can be used. -
GetModelParametersResponseandParameterSchemaare not defined as Pydantic models in the backend. Pydantic models are basically an easier way to define object types, and can provide validation at runtime. -
GetModelParametersResponse.countis not necessary. It is very easy to get the length of a list in most languages. -
ParameterSchemahas two number types:'number'and'integer'. We should probably rename'number'to'float'for clarity.
Context
This issue to track source code comments added here: jonahjung22#1