Skip to content

Commit

Permalink
Add usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Feb 12, 2024
1 parent 00d26ee commit e725cf6
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,34 @@ retrieve the key from an auth-source entry under the `:host` key `api.google-gem
> 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`!
## 🔰 The simplest example

Here is the simplest example that teaches you how to use this library.
This is a function with a `query` and a callback function.

```elisp
(google-gemini-content-generate "How are you?"
(lambda (data)
(message "%s" data)))
```

## 📨 Sending Request

All arguments are exposed in the argument list, so you can send any request in any way you want.

For example, the request function `google-gemini-content-generate` accepts
argument max-tokens. By seeing Google Gemini's references page:

> Max output tokens: Specifies the maximum number of tokens that can be generated
> in the response. A token is approximately four characters. 100 tokens correspond
> to roughly 60-80 words.
```elisp
(google-gemini-content-generate ...
...
:max-output-tokens 100) ; Get roughly 60-80 words!
```

## 🔗 References

- [llm](https://github.com/ahyatt/llm)
Expand All @@ -53,7 +81,6 @@ clone and make pull requests to this repository. Or you can
clone the project and establish your own branch of this tool.
Any methods are welcome!


### 🔬 Development

To run the test locally, you will need the following tools:
Expand Down

0 comments on commit e725cf6

Please sign in to comment.