curl --request POST \
--url https://api.example.com/api/essay \
--header 'Content-Type: application/json' \
--data '
{
"content": "<string>"
}
'{
"structure": 123,
"structureFeedback": "<string>",
"legalAnalysis": 123,
"legalAnalysisFeedback": "<string>",
"writingQuality": 123,
"writingQualityFeedback": "<string>",
"suggestions": [
{}
],
"error": "<string>"
}Analyze bar exam essays using GPT-4 and receive detailed feedback on structure, legal analysis, and writing quality
curl --request POST \
--url https://api.example.com/api/essay \
--header 'Content-Type: application/json' \
--data '
{
"content": "<string>"
}
'{
"structure": 123,
"structureFeedback": "<string>",
"legalAnalysis": 123,
"legalAnalysisFeedback": "<string>",
"writingQuality": 123,
"writingQualityFeedback": "<string>",
"suggestions": [
{}
],
"error": "<string>"
}gpt-4 (or gpt-4-turbo if available)/workspace/source/src/app/api/essay/route.ts:41-52
/workspace/source/src/app/api/essay/route.ts:37
curl -X POST 'https://api.lsattraining.com/api/essay' \
-H 'Content-Type: application/json' \
-d '{
"content": "The law requiring social media age verification raises significant First Amendment concerns. Under strict scrutiny, content-based restrictions on speech must serve a compelling government interest and be narrowly tailored. While protecting minors online is compelling, mandatory age verification may chill protected speech and impose undue burdens on adult users. Less restrictive alternatives, such as parental control tools, should be considered. The law also implicates privacy rights under the Fourth Amendment..."
}'
{
"structure": 0.85,
"structureFeedback": "Your essay follows a clear IRAC structure and effectively organizes constitutional arguments. Consider adding a more explicit conclusion paragraph to strengthen the overall structure.",
"legalAnalysis": 0.88,
"legalAnalysisFeedback": "Excellent identification of First Amendment issues and proper application of strict scrutiny. Your analysis of less restrictive alternatives demonstrates strong legal reasoning. Consider citing relevant precedents like Reno v. ACLU to strengthen your argument.",
"writingQuality": 0.82,
"writingQualityFeedback": "Clear and professional writing style. Some sentences could be more concise. Watch for passive voice in a few areas.",
"suggestions": [
"Add specific case citations to support constitutional arguments",
"Develop the Fourth Amendment privacy analysis further",
"Include discussion of intermediate scrutiny as an alternative framework",
"Strengthen the conclusion with a clear ruling and rationale"
]
}
/workspace/source/src/app/api/essay/route.ts:57-89
{
"error": "Essay content is required"
}
{
"error": "Failed to process feedback. Please try again."
}
{
"error": "Invalid feedback format received from AI"
}
{
"error": "Internal server error. Please try again later."
}
/workspace/source/src/app/api/essay/route.ts