Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/inference/cloudflare_workers_ai.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ def perform!(content)
"Authorization" => "Bearer #{api_token}",
}

payload = { text: [content] }

endpoint = "https://api.cloudflare.com/client/v4/accounts/#{account_id}/ai/run/@cf/#{model}"

conn = Faraday.new { |f| f.adapter FinalDestination::FaradayAdapter }
response = conn.post(endpoint, content.to_json, headers)
response = conn.post(endpoint, payload.to_json, headers)

case response.status
when 200
Expand Down
Loading