Skip to content

Commit

Permalink
Extract key
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Feb 12, 2024
1 parent 3e45ad0 commit 2682f79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ retrieve the key from an auth-source entry under the `:host` key `api.google-gem
(setq google-gemini-key #'google-gemini-key-auth-source)
```

> 💡 Tip
>
> The two variables `google-gemini-key` is the default values for sending requests!
> However, you can still overwrite the value by passing the keywords `:key`!
## 🛠️ Contribute

[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)
Expand Down
4 changes: 2 additions & 2 deletions google-gemini-content.el
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
(cl-defun google-gemini-content-generate ( text callback
&key
(content-type "application/json")
(key google-gemini-key)
(category "HARM_CATEGORY_DANGEROUS_CONTENT")
(threshold "BLOCK_ONLY_HIGH")
stop-sequences
Expand All @@ -41,8 +42,7 @@
top-p
top-k)
"Send generate content request."
(request (format "https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=%s"
google-gemini-key)
(request (format "https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=%s" key)
:type "POST"
:headers (google-gemini--headers content-type)
:data (google-gemini--json-encode
Expand Down

0 comments on commit 2682f79

Please sign in to comment.