Class: LlmClassifier::Adapters::Anthropic
- Defined in:
- lib/llm_classifier/adapters/anthropic.rb
Overview
Adapter for Anthropic API
Constant Summary collapse
- API_URL =
"https://api.anthropic.com/v1/messages"- API_VERSION =
"2023-06-01"
Instance Method Summary collapse
Instance Method Details
#chat(model:, system_prompt:, user_prompt:) ⇒ Object
14 15 16 17 18 |
# File 'lib/llm_classifier/adapters/anthropic.rb', line 14 def chat(model:, system_prompt:, user_prompt:) api_key = validate_api_key response = send_request(model, system_prompt, user_prompt, api_key) parse_response(response) end |