RAG M4 assignment Exercise5

Hi all,

I am taking the RAG course offered by deeplearning.ai from Coursera platform. In the module-4 assignment exercise-5, I face error with including the JSON format into the prompt.
Screenshot of my function definition

The error that I’m facing

Exception: Error while calling LLM: f{
  "id": "oRHP1Yw-57nCBj-9b6189806989fae7",
  "error": {
    "message": "Input validation error",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}

I have also tried to pass the JSON format as separate dictionary defined before the prompt but still facing the error.

How to resolve this issue?

Hello @rasakumaran,
Prompt of your code seems fine, but the response is that generating the error.
You may try: response = … (prompt, temperature=0, max_tokens=1500)
Hope this help.
Best Regards.