Class: Soapstone::AI::Client
- Inherits:
-
Object
- Object
- Soapstone::AI::Client
- Defined in:
- lib/soapstone/core/ai/client.rb
Constant Summary collapse
- PROVIDERS =
{ "open_ai" => Soapstone::AI::OpenAIProvider, "anthropic" => Soapstone::AI::AnthropicProvider }.freeze
Instance Method Summary collapse
- #generate_commit_message(prompt) ⇒ Object
-
#initialize(provider: nil) ⇒ Client
constructor
A new instance of Client.
Constructor Details
Instance Method Details
#generate_commit_message(prompt) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/soapstone/core/ai/client.rb', line 14 def (prompt) raise "No API key configured for AI provider" if default_api_key.nil? provider = @provider_class.new(api_key: default_api_key) provider.(prompt) end |