Sha256: b7c1723c62212abda582c74fbb1a36982863a98e4c15538e0ede93e65815ad7b
Contents?: true
Size: 579 Bytes
Versions: 3
Compression:
Stored size: 579 Bytes
Contents
class SlackSmartBot module AI module OpenAI def self.send_image_generation(open_ai_client, message, image_size) require "openai" user = Thread.current[:user] #todo: personal settings size #Jal response = open_ai_client.images.generate(parameters: { prompt: message, size: image_size }) if !response.body.json(:message).empty? return false, "*OpenAI*: #{response.body.json(:message)}" else urls = [response.body.json(:url)].flatten return true, urls end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems