Skip to content

Commit

Permalink
Small lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tssweeney committed Oct 29, 2024
1 parent c43b9d7 commit 2904d37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {z} from 'zod';

const JSONTypeNames = z.enum(['boolean', 'number', 'string']);
const SimpleJsonReponseFormat = z.object({type: JSONTypeNames});
const ObjectJsonReponseFormat = z.object({
const SimpleJsonResponseFormat = z.object({type: JSONTypeNames});
const ObjectJsonResponseFormat = z.object({
type: z.literal('object'),
properties: z.record(SimpleJsonReponseFormat),
properties: z.record(SimpleJsonResponseFormat),
additionalProperties: z.literal(false),
});

Expand All @@ -13,8 +13,8 @@ export const ConfiguredLlmJudgeActionSchema = z.object({
model: z.enum(['gpt-4o-mini', 'gpt-4o']).default('gpt-4o-mini'),
prompt: z.string(),
response_format: z.discriminatedUnion('type', [
SimpleJsonReponseFormat,
ObjectJsonReponseFormat,
SimpleJsonResponseFormat,
ObjectJsonResponseFormat,
]),
});
export type ConfiguredLlmJudgeActionType = z.infer<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const knownBuiltinActions = [
responseFormat = {
type: 'object',
properties: _.mapValues(data.response_format.schema, value => ({
type: value,
type: value as 'boolean' | 'number' | 'string',
})),
additionalProperties: false,
};
Expand Down

0 comments on commit 2904d37

Please sign in to comment.