Class: FuncBot::Bots::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/func_bot/bots/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bot) ⇒ Client

Returns a new instance of Client.



8
9
10
# File 'lib/func_bot/bots/client.rb', line 8

def initialize(bot)
  @bot = bot
end

Instance Attribute Details

#botObject

Returns the value of attribute bot.



6
7
8
# File 'lib/func_bot/bots/client.rb', line 6

def bot
  @bot
end

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/func_bot/bots/client.rb', line 12

def call
  open_ai.chat(
    parameters: {
      model: "gpt-3.5-turbo-0613",
      messages: bot.history.payload,
      temperature: 0.7,
      functions: FuncBot::Functions::List.call(bot)
    }
  )
end