Install MLX LM:
pip install mlx-lm
And run:
| # The ChatGptService class provides an easy way to integrate with the OpenAI ChatGPT API. | |
| # It allows you to send and receive messages in a conversation thread, and reset the thread | |
| # if necessary. | |
| # | |
| # Example usage: | |
| # chat_gpt_service = ChatGptService.new(BEARER_TOKEN) | |
| # response = chat_gpt_service.chat("Hello, how are you?") | |
| # puts response | |
| # # => {"message"=> | |
| # # {"id"=>"8e78691a-1fde-4bd5-ad68-46b23ea65d8f", |