Skip to content

Commit bb85994

Browse files
committed
docs(gemini): add gemini adapter setup guide
1 parent a9e9a2b commit bb85994

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

doc/configuration/adapters.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,3 +483,39 @@ require("codecompanion").setup({
483483
}),
484484
```
485485

486+
## Setup: Gemini
487+
> This is NOT the Gemini-CLI ACP adapter!
488+
489+
The Gemini adapter uses Google's official [openai-compatible](https://ai.google.dev/gemini-api/docs/openai) endpoint, with one difference: the `reasoning_effort` key is replaced by `thinking_budget`, which controls the number of tokens used by the reasoning process.
490+
491+
```lua
492+
require("codecompanion").setup({
493+
adapters = {
494+
http = {
495+
gemini = function()
496+
return require("codecompanion.adapters").extend("gemini", {
497+
schema = {
498+
thinking_budget = {
499+
default = -1,
500+
},
501+
},
502+
})
503+
end,
504+
},
505+
},
506+
strategies = {
507+
chat = {
508+
adapter = "gemini",
509+
},
510+
inline = {
511+
adapter = "gemini",
512+
},
513+
},
514+
}),
515+
```
516+
517+
The value of `thinking_budget` can be the following:
518+
519+
- `-1`: dynamic thinking (default).
520+
- `0`: disable reasoning.
521+
- A valid positive integer (see [Google's documentation](https://ai.google.dev/gemini-api/docs/thinking#set-budget) for supported thinking budgets for each models).

0 commit comments

Comments
 (0)