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

added contentType field #206

Merged
merged 6 commits into from
Sep 13, 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: 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