Completion API result is not complete and truncated

I have a free account in open AI. Why my result is truncated and shown only a small part of it while using text-davinci-003 model for completion even if my TPM is very small within limit.

The prompt message input is -

“”"Given the details of a students’ skill assessment data in JSON format, generate the result in JSON format containing assessment details including attributes, Topic, Category, Skill, Score, SuggestedImprovements, Strengths and Weakness as following:
** Input: [{“SubjectName”: “Physics”, “Question”: “What is the formula for calculating velocity?”, “ActualAnswer”: “Velocity is calculated by dividing the change in position by the change in time: velocity = displacement / time”, “ExpectedAnswer”: “Velocity is calculated by dividing the change in position by the change in time: velocity = displacement / time”, “Topic”: “Motion”, “Category”: “Physics Basics”, “DifficultyLevel”: “Easy”, “Result”: “Correct”, “Attempt”: “1”, “Feedback”: “Consise answer”, “ExecutionDateTime”: “2015-05-24T05:05:21 -06:-30”}, {“SubjectName”: “Physics”, “Question”: “What is Newton’s second law of motion?”, “ActualAnswer”: “Newton’s second law states that the force acting on an object is directly proportional to its mass and the acceleration produced. It can be expressed as F = m/a.”, “ExpectedAnswer”: “Newton’s second law states that the force acting on an object is directly proportional to its mass and the acceleration produced. It can be expressed as F = ma.”, “Topic”: “Newton’s Laws”, “Category”: “Classical Mechanics”, “DifficultyLevel”: “Medium”, “Result”: “Incorrect”, “Attempt”: “1”, “Feedback”: “Incorrect answer”, “ExecutionDateTime”: “2015-05-24T05:05:21 -06:-30”}, {“SubjectName”: “Physics”, “Question”: “What is the concept of potential energy?”, “ActualAnswer”: “Potential energy is the energy possessed by an object due to its position or condition. It is often associated with the force of gravity and can be calculated as the product of mass, gravity, and height: potential energy = mgh.”, “ExpectedAnswer”: “Potential energy is the energy possessed by an object due to its position or condition. It is often associated with the force of gravity and can be calculated as the product of mass, gravity, and height: potential energy = mgh”, “Topic”: “Potential Energy”, “Category”: “Energy”, “DifficultyLevel”: “Easy”, “Result”: “Correct”, “Attempt”: “1”, “Feedback”: “Correct answer”, “ExecutionDateTime”: “2015-05-24T05:05:21 -06:-30”}, {“SubjectName”: “Physics”, “Question”: “What is the principle of conservation of energy?”, “ActualAnswer”: “The principle of conservation of energy states that energy cannot be created or destroyed, only transferred or transformed from one form to another. The total energy in a closed system remains constant.”, “ExpectedAnswer”: “The principle of conservation of energy states that energy cannot be created or destroyed, only transferred or transformed from one form to another. The total energy in a closed system remains constant.”, “Topic”: “Conservation of Energy”, “Category”: “Energy”, “DifficultyLevel”: “Medium”, “Result”: “Correct”, “Attempt”: “1”, “Feedback”: “Correct answer”, “ExecutionDateTime”: “2015-05-24T05:05:21 -06:-30”}, {“SubjectName”: “Physics”, “Question”: “What is the equation for calculating electric power?”, “ActualAnswer”: “Electric power can be calculated using the formula: power = voltage / current”, “ExpectedAnswer”: “Electric power can be calculated using the formula: power = voltage \u00d7 current.”, “Topic”: “Electric Power”, “Category”: “Electricity”, “DifficultyLevel”: “Easy”, “Result”: “Incorrect”, “Attempt”: “1”, “Feedback”: “Incorrect formula”, “ExecutionDateTime”: “2015-05-24T05:05:21 -06:-30”}]**
** Result: {“AssessmentScore”: {“SubjectName”: “Physics”, “TotalQuestions”: 5, “CorrectAnswers”: 3, “IncorrectAnswers”: 2, “ScorePercentage”: 60}, “SuggestedImprovements”: [“Provide more context or explanation when answering physics questions”, “Consider including units of measurement in the answer”, “Demonstrate understanding of key concepts by providing examples or applications”], “Strengths”: [“Velocity Calculation”, “Potential Energy”, “Conservation of Energy”], “AreasOfWeakness”: [{“Category”: “Classical Mechanics”, “Feedback”: “Newton’s second law of motion”}, {“Category”: “Electricity”, “Feedback”: “The equation for calculating electric power”}], “Skills”: [“Velocity Calculation”, “Newton’s Laws”, “Potential Energy”, “Conservation of Energy”, “Electric Power”]}**
** Input: [{“SubjectName”: “Physics”, “Question”: “What is the formula for calculating velocity?”, “ActualAnswer”: “Velocity is calculated by dividing the change in position by the change in time: velocity = displacement / time”, “ExpectedAnswer”: “Velocity is calculated by dividing the change in position by the change in time: velocity = displacement / time”, “Topic”: “Motion”, “Category”: “Physics Basics”, “DifficultyLevel”: “Easy”, “Result”: “Correct”, “Attempt”: “1”, “Feedback”: “Consise answer”, “ExecutionDateTime”: “2015-05-24T05:05:21 -06:-30”}, {“SubjectName”: “Physics”, “Question”: “What is Newton’s second law of motion?”, “ActualAnswer”: “Newton’s second law states that the force acting on an object is directly proportional to its mass and the acceleration produced. It can be expressed as F = m/a.”, “ExpectedAnswer”: “Newton’s second law states that the force acting on an object is directly proportional to its mass and the acceleration produced. It can be expressed as F = ma.”, “Topic”: “Newton’s Laws”, “Category”: “Classical Mechanics”, “DifficultyLevel”: “Medium”, “Result”: “Incorrect”, “Attempt”: “1”, “Feedback”: “Incorrect answer”, “ExecutionDateTime”: “2015-05-24T05:05:21 -06:-30”}, {“SubjectName”: “Physics”, “Question”: “What is the concept of potential energy?”, “ActualAnswer”: “Potential energy is the energy possessed by an object due to its position or condition. It is often associated with the force of gravity and can be calculated as the product of mass, gravity, and height: potential energy = mgh.”, “ExpectedAnswer”: “Potential energy is the energy possessed by an object due to its position or condition. It is often associated with the force of gravity and can be calculated as the product of mass, gravity, and height: potential energy = mgh”, “Topic”: “Potential Energy”, “Category”: “Energy”, “DifficultyLevel”: “Easy”, “Result”: “Correct”, “Attempt”: “1”, “Feedback”: “Correct answer”, “ExecutionDateTime”: “2015-05-24T05:05:21 -06:-30”}, {“SubjectName”: “Physics”, “Question”: “What is the principle of conservation of energy?”, “ActualAnswer”: “The principle of conservation of energy states that energy cannot be created or destroyed, only transferred or transformed from one form to another. The total energy in a closed system remains constant.”, “ExpectedAnswer”: “The principle of conservation of energy states that energy cannot be created or destroyed, only transferred or transformed from one form to another. The total energy in a closed system remains constant.”, “Topic”: “Conservation of Energy”, “Category”: “Energy”, “DifficultyLevel”: “Medium”, “Result”: “Correct”, “Attempt”: “1”, “Feedback”: “Correct answer”, “ExecutionDateTime”: “2015-05-24T05:05:21 -06:-30”}, {“SubjectName”: “Physics”, “Question”: “What is the equation for calculating electric power?”, “ActualAnswer”: “Electric power can be calculated using the formula: power = voltage / current”, “ExpectedAnswer”: “Electric power can be calculated using the formula: power = voltage \u00d7 current.”, “Topic”: “Electric Power”, “Category”: “Electricity”, “DifficultyLevel”: “Easy”, “Result”: “Incorrect”, “Attempt”: “1”, “Feedback”: “Incorrect formula”, “ExecutionDateTime”: “2015-05-24T05:05:21 -06:-30”}]**
** Result:“”"**

But the response is truncated and not complete.

{

  • “AssessmentScore”: {*
  • “SubjectName”: "*

Kindly help with some leads to the solution.

What’s your code look like? Are you specifying max_tokens? Try switching to gpt-3.5-turbo-16k which allows more tokens and is smarter and cheaper than davinci.