Commit f0f89e6

mo khan <mo@mokhan.ca>
2026-03-11 21:21:33
refactor: inline usage of Claude.anthropic
1 parent 1061f33
Changed files (2)
.elelem
lib
elelem
.elelem/plugins/anthropic.rb
@@ -1,8 +1,10 @@
 # frozen_string_literal: true
 
 Elelem::Providers.register(:anthropic) do
-  Elelem::Net::Claude.anthropic(
+  api_key = ENV.fetch("ANTHROPIC_API_KEY")
+  Elelem::Net::Claude.new(
+    endpoint: "https://api.anthropic.com/v1/messages",
+    headers: { "x-api-key" => api_key, "anthropic-version" => "2023-06-01" },
     model: ENV.fetch("ANTHROPIC_MODEL", "claude-opus-4-5-20250514"),
-    api_key: ENV.fetch("ANTHROPIC_API_KEY")
   )
 end
lib/elelem/net/claude.rb
@@ -3,15 +3,6 @@
 module Elelem
   module Net
     class Claude
-      def self.anthropic(model:, api_key:, http: Elelem::Net.http)
-        new(
-          endpoint: "https://api.anthropic.com/v1/messages",
-          headers: { "x-api-key" => api_key, "anthropic-version" => "2023-06-01" },
-          model:,
-          http:
-        )
-      end
-
       def self.vertex(model:, project:, region: "us-east5", http: Elelem::Net.http)
         new(
           endpoint: "https://#{region}-aiplatform.googleapis.com/v1/projects/#{project}/locations/#{region}/publishers/anthropic/models/#{model}:rawPredict",