-
Notifications
You must be signed in to change notification settings - Fork 640
Adding zod validation #690
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
base: main
Are you sure you want to change the base?
Adding zod validation #690
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Added Zod schema validation across LLM clients to provide consistent, type-safe response handling and improved error reporting.
- Added new
types/zod.ts
withvalidateZodSchemaWithResult
utility for standardized schema validation - Introduced
CreateChatCompletionResponseValidationError
for structured validation failures - Implemented consistent validation in both GoogleClient and OpenAIClient with detailed error messages
- Added retry mechanism when validation fails in both LLM clients
- Aligned validation approach between providers while maintaining provider-specific response handling
💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
4 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…rlAltGiri/stagehand into giri/stagehand-zod-validation
why
Adding zod validation errors in the error response to ensure better debugging for developers.
Resolving issue: #689
what changed
test plan