Skip to content

Commit

Permalink
simplify headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Feb 11, 2024
1 parent 973e6b1 commit 19ff023
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions google-gemini.el
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,7 @@ If BASE-URL is not specified, it defaults to `google-gemini-base-url'."
Arguments CONTENT-TYPE are common request headers."
(google-gemini--alist-omit-null
`(("Content-Type" . ,content-type)
,(if (or (null key)
(string-empty-p key))
""
(pcase openai-key-type
(:bearer `("Authorization" . ,(concat "Bearer " key)))
(:azure-api `("api-key" . ,key))
(_ (user-error "Invalid key type: %s"
openai-key-type))))
)))
`(("Content-Type" . ,content-type))))

(defun google-gemini--json-encode (object)
"Wrapper for function `json-encode' but it remove nil value before
Expand Down

0 comments on commit 19ff023

Please sign in to comment.