Redefine the repository as a collection of Zod AI prompt samples#4
Redefine the repository as a collection of Zod AI prompt samples#4akazah wants to merge 3 commits into
Conversation
- Rewrite README in English to describe the repository as a collection of samples for using Zod schemas as AI prompts - Reorganize 4oEverPrompt as a sample under samples/4oEverPrompt/ - Add sample-specific README explaining the schema features and techniques - Update package.json with new name, description, and keywords - Keep both English and Japanese versions of the prompt This positions the repository as an extensible sample collection where 4oEverPrompt is the first example of using Zod schemas to structure AI responses. Co-authored-by: akazawa.hitoshi <akazawa.hitoshi@gmail.com>
- Add README_ja.md for main repository documentation - Add samples/4oEverPrompt/README_ja.md for sample documentation - Add language toggle links between English and Japanese versions Co-authored-by: akazawa.hitoshi <akazawa.hitoshi@gmail.com>
- Add schema.ts with TypeScript schema for Structured Outputs - Document provider-specific usage (OpenAI, Anthropic, Google, Vercel AI SDK) - Include code examples for zodResponseFormat() and generateObject() - Update all READMEs (English/Japanese) with Structured Outputs section - Add usage examples in sample READMEs This enables developers to use Zod schemas with AI provider's native structured output features for guaranteed schema compliance. Co-authored-by: akazawa.hitoshi <akazawa.hitoshi@gmail.com>
|
Cursor Agent can help with this pull request. Just |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 238313108b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| header: z | ||
| .string() | ||
| .describe("Header prefixed with a single positive emoji character and a space. Example: '🌟 Your Amazing Question'") | ||
| .min(20) | ||
| .max(40), |
There was a problem hiding this comment.
Enforce emoji-prefixed headers in section schema
The schema description promises headers are prefixed with a single emoji and space, but the Zod validator only applies length constraints here. As a result, validateReply (and Structured Outputs that rely on this schema) will accept headers with no emoji prefix, which contradicts the stated format in this sample and the prompt-based schema. This means consumers can get “valid” outputs that fail the intended formatting requirements, especially when they rely on validation rather than prompt instructions.
Useful? React with 👍 / 👎.
Redefine the repository as a collection of Zod AI prompt samples, rewrite READMEs in English and Japanese, and restructure
4oEverPromptas the first sample.