Skip to content

Commit

Permalink
fix: fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
0xcadams committed Nov 8, 2023
1 parent 677cfd5 commit 7abdf35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,13 @@ export abstract class BaseHopfieldFunction<
.describe(
'The arguments to call the function with, as generated by the model in JSON format and coerced into the provided schema. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema.',
)
.transform((obj): z.infer<typeof this.parameters> => {
.transform((obj) => {
const result = this.parameters.safeParse(obj);
if (!result.success) {
throw result.error;
}
return result.data;
}) as typeof this.parameters['_output'],
}) as unknown as typeof this.parameters,
});
}

Expand Down

0 comments on commit 7abdf35

Please sign in to comment.