Skip to content

Commit

Permalink
added headers for openrouter
Browse files Browse the repository at this point in the history
  • Loading branch information
jbotwell committed Jul 21, 2024
1 parent 2409cd5 commit b27eba9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lua/gp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,7 @@ M.query = function(buf, provider, payload, handler, on_exit, callback)

process_lines(complete_lines)
end
-- chunk is nil when EOF is reached
-- chunk is nil when EOF is reached
else
-- if there's remaining data in the buffer, process it
if #buffer > 0 then
Expand Down Expand Up @@ -1476,6 +1476,13 @@ M.query = function(buf, provider, payload, handler, on_exit, callback)
}
end

if provider == "openrouter" then
headers = {
"-H",
"Authorization: Bearer " .. bearer,
}
end

if provider == "pplx" then
headers = {
"-H",
Expand Down

0 comments on commit b27eba9

Please sign in to comment.