Class: RubyLLM::Contract::Adapters::RubyLLM
- Defined in:
- lib/ruby_llm/contract/adapters/ruby_llm.rb
Constant Summary collapse
- CHAT_OPTION_METHODS =
Maps option keys to the RubyLLM chat method and argument form.
{ temperature: :with_temperature, schema: :with_schema }.freeze
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#call(messages:, **options) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/ruby_llm/contract/adapters/ruby_llm.rb', line 9 def call(messages:, **) system_contents, conversation = () conversation = fallback_conversation(system_contents, conversation) chat = build_chat(, system_contents) add_history(chat, conversation[0..-2]) response = chat.ask(conversation.last&.fetch(:content, "")) build_response(response) end |