Skip to content

Commit e725cf6

Browse files
committed
Add usage
1 parent 00d26ee commit e725cf6

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,34 @@ retrieve the key from an auth-source entry under the `:host` key `api.google-gem
3737
> The two variables `google-gemini-key` is the default values for sending requests!
3838
> However, you can still overwrite the value by passing the keywords `:key`!
3939
40+
## 🔰 The simplest example
41+
42+
Here is the simplest example that teaches you how to use this library.
43+
This is a function with a `query` and a callback function.
44+
45+
```elisp
46+
(google-gemini-content-generate "How are you?"
47+
(lambda (data)
48+
(message "%s" data)))
49+
```
50+
51+
## 📨 Sending Request
52+
53+
All arguments are exposed in the argument list, so you can send any request in any way you want.
54+
55+
For example, the request function `google-gemini-content-generate` accepts
56+
argument max-tokens. By seeing Google Gemini's references page:
57+
58+
> Max output tokens: Specifies the maximum number of tokens that can be generated
59+
> in the response. A token is approximately four characters. 100 tokens correspond
60+
> to roughly 60-80 words.
61+
62+
```elisp
63+
(google-gemini-content-generate ...
64+
...
65+
:max-output-tokens 100) ; Get roughly 60-80 words!
66+
```
67+
4068
## 🔗 References
4169

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

56-
5784
### 🔬 Development
5885

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

0 commit comments

Comments
 (0)