chat_completion function

Generate Text Using the OpenAI API's Chat Endpoint