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

fix: get evaluation result #181

Merged
merged 1 commit into from
Apr 6, 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start:ml": ". ./packages/ml/venv/bin/activate && python3 packages/ml/main.py",
"build:frontend": "npm -w packages/frontend run build",
"migrate:db": "npm -w packages/backend run migrate:db",
"dev": "concurrently \"npm run dev:frontend\" \"npm run dev:backend\" \"npm run dev:radar\"",
"dev": "concurrently \"npm run dev:frontend\" \"npm run dev:backend\"",
"dev:frontend": "npm -w packages/frontend run dev",
"dev:backend": "npm -w packages/backend run dev",
"dev:radar": "npm -w packages/backend run dev:radar",
Expand Down
22 changes: 13 additions & 9 deletions packages/backend/src/api/v1/evaluations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,21 @@ evaluations.get(
checkAccess("evaluations", "read"),
async (ctx: Context) => {
const { evaluationId } = ctx.params
const { projectId } = ctx.state

const results = await sql`
select
*,
p.id as prompt_id
from
evaluation_result er
left join dataset_prompt p on p.id = er.prompt_id
left join dataset_prompt_variation pv on pv.id = er.variation_id
where
er.evaluation_id = ${evaluationId}`
select
*,
p.id as prompt_id
from
evaluation_result er
left join evaluation e on e.id = er.evaluation_id
left join dataset_prompt p on p.id = er.prompt_id
left join dataset_prompt_variation pv on pv.id = er.variation_id
where
er.evaluation_id = ${evaluationId}
and e.project_id = ${projectId}
`

ctx.body = results
},
Expand Down
Loading