diff --git a/config/config.sample.edn b/config/config.sample.edn index 271ebc65..80539326 100644 --- a/config/config.sample.edn +++ b/config/config.sample.edn @@ -52,11 +52,11 @@ :url "http://localhost:3003", :ebay {:appid ""}, :gemini {:api {:key "" - ;; optional: override the default model (gemini-3.6-flash-image-preview) - ;; :model "gemini-3.6-flash-image-preview" + ;; optional: override the default model (gemini-3.1-flash-image-preview) + ;; :model "gemini-3.1-flash-image-preview" ;; monthly budget in USD for image generation (default: 10.00) ;; :monthly-budget 10.00 - ;; estimated cost per image in USD (default: 0.045 for Gemini 3.6 Flash 512px) + ;; estimated cost per image in USD (default: 0.045 for Gemini 3.1 Flash 512px) ;; :cost-per-image 0.045 }} :giphy {:key ""}, diff --git a/src/yetibot/core/util/gemini.clj b/src/yetibot/core/util/gemini.clj index fca8c66c..53b50a54 100644 --- a/src/yetibot/core/util/gemini.clj +++ b/src/yetibot/core/util/gemini.clj @@ -26,7 +26,7 @@ ;; (YB_GEMINI_KEY) with the rest of Yetibot's Gemini features. (def config (or (:value (get-config ::config [:gemini])) {})) -(def default-model "gemini-3.6-flash-image-preview") +(def default-model "gemini-3.1-flash-image-preview") (defn gemini-model [] default-model) @@ -48,7 +48,7 @@ ;; -- Monthly budget throttling -- (def ^:private default-cost-per-image - "Default estimated cost per generated image in USD (gemini-3.6-flash-image-preview pricing, tied to default-model)." + "Default estimated cost per generated image in USD (gemini-3.1-flash-image-preview pricing, tied to default-model)." 0.039) (def ^:private default-monthly-budget @@ -58,7 +58,7 @@ (defn cost-per-image [] (or (parse-number (-> config :cost :per)) (case (gemini-model) - "gemini-3.6-flash-image-preview" 0.039 + "gemini-3.1-flash-image-preview" 0.039 ;; Add other models and their costs here as needed default-cost-per-image))) diff --git a/test/yetibot/core/test/commands/bameme_test.clj b/test/yetibot/core/test/commands/bameme_test.clj index ba806a52..5c272bbd 100644 --- a/test/yetibot/core/test/commands/bameme_test.clj +++ b/test/yetibot/core/test/commands/bameme_test.clj @@ -6,7 +6,7 @@ (facts "about bameme-cmd" (fact "it generates a meme and returns URL with model and cost footer" (bm/bameme-cmd {:match "bameme drake: writing tests / shipping to prod" :chat-source {}}) - => (contains {:result/value #"http://localhost:3003/generated-images/img123.png\n\nSent via gemini-3.6-flash-image-preview \| Cost: \$0.039" + => (contains {:result/value #"http://localhost:3003/generated-images/img123.png\n\nSent via gemini-3.1-flash-image-preview \| Cost: \$0.039" :result/data {:id "img123" :prompt "bameme drake: writing tests / shipping to prod" :url "http://localhost:3003/generated-images/img123.png"}}) (provided (gemini/configured?) => true @@ -14,5 +14,5 @@ (gemini/generate-image "Create a meme in the style of the 'drake' meme template with this text: writing tests / shipping to prod" anything []) => {:data "bytes" :mime-type "image/png"} (yetibot.core.webapp.routes.images/store-image! {:data "bytes" :mime-type "image/png"}) => "img123" (gemini/yetibot-base-url) => "http://localhost:3003" - (gemini/gemini-model) => "gemini-3.6-flash-image-preview" + (gemini/gemini-model) => "gemini-3.1-flash-image-preview" (gemini/cost-per-image) => 0.039))) diff --git a/test/yetibot/core/test/commands/banana_test.clj b/test/yetibot/core/test/commands/banana_test.clj index c7ce5096..b35c9b38 100644 --- a/test/yetibot/core/test/commands/banana_test.clj +++ b/test/yetibot/core/test/commands/banana_test.clj @@ -27,7 +27,7 @@ (facts "about banana-cmd" (fact "it generates an image and returns URL with model and cost footer" (b/banana-cmd {:match "banana monkey" :chat-source {}}) - => (contains {:result/value #"http://localhost:3003/generated-images/img123.png\n\nSent via gemini-3.6-flash-image-preview \| Cost: \$0.039" + => (contains {:result/value #"http://localhost:3003/generated-images/img123.png\n\nSent via gemini-3.1-flash-image-preview \| Cost: \$0.039" :result/data {:id "img123" :prompt "banana monkey" :url "http://localhost:3003/generated-images/img123.png"}}) (provided (gemini/configured?) => true @@ -35,5 +35,5 @@ (gemini/generate-image "Generate an image: monkey" b/banana-system-instruction []) => {:data "bytes" :mime-type "image/png"} (yetibot.core.webapp.routes.images/store-image! {:data "bytes" :mime-type "image/png"}) => "img123" (gemini/yetibot-base-url) => "http://localhost:3003" - (gemini/gemini-model) => "gemini-3.6-flash-image-preview" + (gemini/gemini-model) => "gemini-3.1-flash-image-preview" (gemini/cost-per-image) => 0.039))) diff --git a/test/yetibot/core/test/commands/weathermap_test.clj b/test/yetibot/core/test/commands/weathermap_test.clj index 6b53541b..5dbbaf66 100644 --- a/test/yetibot/core/test/commands/weathermap_test.clj +++ b/test/yetibot/core/test/commands/weathermap_test.clj @@ -10,7 +10,7 @@ (fact "it generates a weather map image and returns URL" (wm/weathermap-cmd {:chat-source {} :user {:username "test-user"}}) - => (contains {:result/value #"http://localhost:3003/generated-images/img456.png\n\nSent via gemini-3.6-flash-image-preview \| Cost: \$0.039" + => (contains {:result/value #"http://localhost:3003/generated-images/img456.png\n\nSent via gemini-3.1-flash-image-preview \| Cost: \$0.039" :result/data {:id "img456" :prompt "A highly detailed, professional weather map of North America showing temperature heat map, wind movements (using beautiful swirling arrows and streamlines), and air quality index overlays. Use modern weather graphics. The current conditions for reference in some cities are: Edmonton: 15C, Sunnyvale: 25C" :url "http://localhost:3003/generated-images/img456.png"}}) @@ -20,5 +20,5 @@ (gemini/generate-image "A highly detailed, professional weather map of North America showing temperature heat map, wind movements (using beautiful swirling arrows and streamlines), and air quality index overlays. Use modern weather graphics. The current conditions for reference in some cities are: Edmonton: 15C, Sunnyvale: 25C" anything) => {:data "bytes" :mime-type "image/png"} (yetibot.core.webapp.routes.images/store-image! {:data "bytes" :mime-type "image/png"}) => "img456" (gemini/yetibot-base-url) => "http://localhost:3003" - (gemini/gemini-model) => "gemini-3.6-flash-image-preview" + (gemini/gemini-model) => "gemini-3.1-flash-image-preview" (gemini/cost-per-image) => 0.039)))