Class: RubyCanUseLLM::Providers::Anthropic
- Defined in:
- lib/rubycanusellm/providers/anthropic.rb
Constant Summary collapse
- API_URL =
"https://api.anthropic.com/v1/messages"
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from RubyCanUseLLM::Providers::Base
Instance Method Details
#chat(messages, **options, &block) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rubycanusellm/providers/anthropic.rb', line 12 def chat(, **, &block) system, = extract_system() if [:stream] && block body = build_body(system, , .except(:stream)).merge(stream: true) stream_request(body, &block) else body = build_body(system, , ) response = request(body) parse_response(response) end end |