diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/collections/actionCollection.ts b/weave-js/src/components/PagePanelComponents/Home/Browse3/collections/actionCollection.ts index 4712b0b5409..c79c820b2a4 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/collections/actionCollection.ts +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/collections/actionCollection.ts @@ -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), }); @@ -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< diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ScorersPage/NewBuiltInActionScorerModal.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ScorersPage/NewBuiltInActionScorerModal.tsx index 2d9cd10afe0..f332e36d77c 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ScorersPage/NewBuiltInActionScorerModal.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ScorersPage/NewBuiltInActionScorerModal.tsx @@ -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, };