Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcrt committed Jul 9, 2024
1 parent 4479d59 commit 0b78c50
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions packages/backend/src/evaluators/pii.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,26 @@ function parseMessages(messages: unknown) {
interface Params {
entities: string[]
}
export async function evaluate(run: Run, params: Oarans) {
export async function evaluate(run: Run, params: Params) {
const { entities } = params
const input = parseMessages(run.input)
const output = parseMessages(run.output)
const error = parseMessages(run.error)

const [inputLanguages, outputLanguages, errrorLanguages] = await Promise.all([
const [inputPIIs, outputPIIs, errorPIIs] = await Promise.all([
detectPIIs(input, entities),
detectPIIs(output, entities),
detectPIIs(error, entities),
])

const languages = {
input: inputLanguages,
output: outputLanguages,
error: errrorLanguages,
const PIIs = {
input: inputPIIs,
output: outputPIIs,
error: errorPIIs,
}

// TODO: zod for languages, SHOLUD NOT INGEST IN DB IF NOT CORRECT FORMAT

return languages
return PIIs
}

// TODO: type
Expand Down

0 comments on commit 0b78c50

Please sign in to comment.