Skip to content

Commit 790e424

Browse files
committed
use flash model as default
1 parent 5dc2aea commit 790e424

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ Demo https://r.tiye.me/Termina/msg-buffer/ .
88

99
Docs https://ai.google.dev/gemini-api/docs/get-started/tutorial?lang=rest#text-and-image_input .
1010

11+
Configurations:
12+
13+
- `gemini-key` in localStorage
14+
- `?model=YOUR_MODEL`, defaults to `gemini-1.5-flash`
15+
1116
### Workflow
1217

1318
https://github.com/calcit-lang/respo-calcit-workflow

calcit.cirru

+20-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compact.cirru

+5-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
key $ js/localStorage.getItem "\"gemini-key"
6464
if (blank? key) (js/alert "\"Required gemini-key in localStorage")
6565
, key
66+
|pick-model $ %{} :CodeEntry (:doc |)
67+
:code $ quote
68+
defn pick-model () $ get-env "\"model" "\"gemini-1.5-flash"
6669
|style-more $ %{} :CodeEntry (:doc |)
6770
:code $ quote
6871
defstyle style-more $ {}
@@ -76,7 +79,8 @@
7679
d! cursor $ -> state (assoc :answer nil) (assoc :loading? true)
7780
let
7881
result $ js-await
79-
.!post axios "\"https://sf.chenyong.life/v1beta/models/gemini-1.5-pro:streamGenerateContent"
82+
.!post axios
83+
str "\"https://sf.chenyong.life/v1beta/models/" (pick-model) "\":streamGenerateContent"
8084
js-object $ :contents
8185
js-array $ js-object
8286
:parts $ js-array

0 commit comments

Comments
 (0)