Skip to content

Commit

Permalink
added contentType field (#206)
Browse files Browse the repository at this point in the history
Co-authored-by: nenadnovovicqc <nenad.novovic@qcerris.com>
Co-authored-by: Adam Nolte <ajnolte12@gmail.com>
Co-authored-by: Adam Nolte <adam@autoblocks.ai>
  • Loading branch information
4 people committed Sep 13, 2024
1 parent 08b1638 commit 712fc72
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/testing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export {
type EvaluationOverrideComment,
type EvaluationOverrideField,
type ScoreChoice,
type HumanReviewField,
HumanReviewFieldContentType,
} from './models';
export { gridSearchAsyncLocalStorage } from '../asyncLocalStorage';
export {
Expand Down
8 changes: 8 additions & 0 deletions src/testing/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,17 @@ export abstract class BaseEvaluator<TestCaseType, OutputType>
}): Evaluation | Promise<Evaluation>;
}

export enum HumanReviewFieldContentType {
TEXT = 'text',
LINK = 'link',
HTML = 'html',
MARKDOWN = 'markdown',
}

export interface HumanReviewField {
name: string;
value: string;
contentType?: HumanReviewFieldContentType;
}

/**
Expand Down
3 changes: 3 additions & 0 deletions test/testing/run.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
TracerEvent,
BaseEvaluator,
gridSearchAsyncLocalStorage,
HumanReviewFieldContentType,
} from '../../src/testing';
import * as testingUtilModule from '../../src/testing/util';
import crypto from 'crypto';
Expand Down Expand Up @@ -1128,6 +1129,7 @@ describe('Testing SDK', () => {
{
name: 'y',
value: `${testCase.x}`,
contentType: HumanReviewFieldContentType.MARKDOWN,
},
{
name: 'sum',
Expand Down Expand Up @@ -1161,6 +1163,7 @@ describe('Testing SDK', () => {
{
name: 'y',
value: '1',
contentType: HumanReviewFieldContentType.MARKDOWN,
},
{
name: 'sum',
Expand Down

0 comments on commit 712fc72

Please sign in to comment.