ai: Add JSON format instruction to AI prompt system messages#1296
Open
ai: Add JSON format instruction to AI prompt system messages#1296
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| - Exclude opaque technical identifiers like account IDs, payment IDs, tracking tokens, or long alphanumeric strings that aren't meaningful to users. | ||
| `; | ||
|
|
||
| Return your response in JSON format.`; |
Contributor
There was a problem hiding this comment.
System prompt now demands JSON null for spam but the schema defined earlier only accepts { content: string }, so generateObject will throw a TypeValidationError whenever spam is reported and we end up treating it as a failure (with retries/logs) instead of a clean null summary; can we allow the schema/handler to accept null before parsing?
Suggested change
| Return your response in JSON format.`; | |
| Return your response in JSON format as an object matching the schema (with a "content" string property); for spam, promotional, or irrelevant emails, return { "content": "" }.` |
Finding type: Breaking Changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Adds explicit "Return your response in JSON format." instruction to system prompts across AI utility functions.
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Enhances the reliability of AI-driven features by explicitly instructing the LLM to return responses in JSON format across multiple system prompts. This change affects core utility functions responsible for email summarization, document filing intent parsing, and comprehensive email behavior analysis.
Latest Contributors(2)