Hi Neeraj,
The way the API works is by providing instructions and examples of the kind of completions you want. I see that you’re using the chat prompt example, which is meant for conversation (not code generation). There’s also a return key stop sequence, so it’s impossible to get multi-line completions.
You can see a code example here.