Skip to content

Commit

Permalink
fix: pulling datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
vincelwt committed Mar 11, 2024
1 parent 0652493 commit 59d3a83
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/backend/src/api/v1/datasets/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sql from "@/src/utils/db"
import { compilePrompt } from "@/src/utils/playground"
import { compilePrompt, compileTextTemplate } from "@/src/utils/playground"

export async function getDatasetById(datasetId: string, projectId: string) {
const [dataset] =
Expand Down Expand Up @@ -59,7 +59,10 @@ export async function getDatasetBySlug(slug: string, projectId: string) {

for (const { promptMessages, variables, idealOutput, context } of rows) {
const item = {
input: compilePrompt(promptMessages, variables),
input:
typeof promptMessages === "string"
? compileTextTemplate(promptMessages, variables)
: compilePrompt(promptMessages, variables),
idealOutput,
context,
}
Expand Down

0 comments on commit 59d3a83

Please sign in to comment.