[DERCBOT-1887/1888] Create evaluation from dataset + Delete run#2048
[DERCBOT-1887/1888] Create evaluation from dataset + Delete run#2048scezen wants to merge 6 commits into
Conversation
rkuffer
left a comment
There was a problem hiding this comment.
Ok for the front part.
Thanks for the work
assouktim
left a comment
There was a problem hiding this comment.
Revise the code design to use the existing API
| val dataset = getDatasetEntity(namespace, botId, datasetId) | ||
| val run = getRunEntity(namespace, botId, dataset._id.toString(), runId) | ||
|
|
||
| if (run.state == DatasetRunState.QUEUED || run.state == DatasetRunState.RUNNING) { |
There was a problem hiding this comment.
It's best to filter out records with the “COMPLETED” status; otherwise, you'll also miss those with the “CANCELLED” status.
| throw DatasetError.RunNotFinished(runId, run.state) | ||
| } | ||
|
|
||
| if (run.endTime == null) { |
There was a problem hiding this comment.
I don't think that's necessary. It's redundant compared to the previous check.
| return EvaluationSampleDTO.from(savedSample, evaluationsResult) | ||
| } | ||
|
|
||
| fun createEvaluationSampleFromRun( |
There was a problem hiding this comment.
The code is duplicated from the existing createEvaluationSample function. In principle, only the instantiation of the evaluation will change; the rest of the code remains unchanged.
| } | ||
| } | ||
|
|
||
| blockingJsonPost( |
There was a problem hiding this comment.
I think we can use the existing API instead of creating a new one, since the goal is to generate the evaluation using either the information from the dialogs or the information from the dataset run.
data class CreateEvaluationSampleRequest(
val name: String?,
val description: String?,
val dialogInfo: DialogInfo?,
val datasetRunInfo: DatasetRunInfo?,
)
data class DialogInfo(
val dialogActivityFrom: Instant,
val dialogActivityTo: Instant,
val requestedDialogCount: Int,
val allowTestDialogs: Boolean = false,
)
data class DatasetRunInfo(
val runIds: List<String>
)
No description provided.