-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
A common scenario is to have multiple types that each signify an action. This could be translated to different function calls in a natural way.
Say I have action X and action y.
I'd build a type which is like this:
type action = { type: 'x', xParam: number } | { type: 'y', yParam: string }in zod this would be a z.union.
but the zod-gpt doesn't let you use union and the user needs to resort to something like thiis:
type action = { type: 'x' | 'y', xParam: number, yParam: string } // mixing both actions parametersthis would result in much less type safety, not to mention name collisions that disagree on the property type.
maybe there is a solution I missed?
if not, maybe this is possible to implement by mapping each action to a different function_call.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels