The askQuestion function in the AI utility returns unformatted responses that include extra AI-generated context and formatting. Unlike the analyze function which uses StructuredOutputParser to ensure clean, predictable output, the Q&A responses come with additional text from the AI model that makes the output inconsistent and less user-friendly.
📸 Current Behavior
- Q&A responses include extra AI commentary and formatting
- Responses are not structured or predictable
- Raw AI output may contain unnecessary context or explanations
- Inconsistent response format compared to the analysis feature
✅ Expected Behavior
- Structured Output: Use StructuredOutputParser with Zod schema for consistent formatting
- Clean Responses: Remove extra AI commentary and return only the relevant answer
- Consistent Format: Match the implementation pattern used in the analyze function
- Predictable Structure: Define a clear schema for Q&A responses
🔧 Technical Details
File to modify: [ai.ts]
Testing on Deployed Version
To test this issue on the live deployment, check the CONTRIBUTING.md file for:
- 🔗 Deployed application URL
- 🧪 Test account credentials with pre-filled journal entries
- ⚠️ OpenAI API rate limiting information (15 calls per user)
The askQuestion function in the AI utility returns unformatted responses that include extra AI-generated context and formatting. Unlike the analyze function which uses StructuredOutputParser to ensure clean, predictable output, the Q&A responses come with additional text from the AI model that makes the output inconsistent and less user-friendly.
📸 Current Behavior
✅ Expected Behavior
🔧 Technical Details
File to modify: [ai.ts]
Testing on Deployed Version
To test this issue on the live deployment, check the CONTRIBUTING.md file for: