Adding tool combination support#68
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds a Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant Chat as Chat (client)
participant Gemini as Gemini API
participant Tools as Server-side Tools
User->>Chat: send message / start chat
Chat->>Gemini: build request payload
Note right of Chat: includes function_calling_config.mode = "AUTO"\nand tool_config.includeServerSideToolInvocations = tool_combination_enabled
Gemini->>Tools: invoke tools if payload requests (google_search, url_context)
Tools-->>Gemini: tool results
Gemini-->>Chat: response (may include tool-invocations/results)
Chat-->>User: final response
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/code.gs`:
- Around line 306-308: The methods enableToolCombination and enableCompaction
are coercing any truthy value via Boolean(enabled) though their JSDoc promises a
boolean; change them to enforce boolean input by validating typeof enabled ===
"boolean" and either assign enabled directly to the internal flags (e.g.,
tool_combination_enabled, compaction_enabled) or throw a TypeError when a
non-boolean is passed, and return this for chaining; update the implementations
of enableToolCombination and enableCompaction accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: f8e68d44-3de2-4050-a571-ff1aa506e4d1
📒 Files selected for processing (1)
src/code.gs
📜 Review details
🔇 Additional comments (3)
src/code.gs (3)
2457-2457: No actionable issue for EOF newline-only change.
57-57: Good default for feature rollout.
tool_combination_enabled = falseat Line 57 is a safe default and preserves existing behavior until explicitly enabled.
764-769: I need the review comment text to rewrite. Please provide the original review comment you would like me to verify and rewrite.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/code.gs`:
- Around line 764-769: The request payload is adding
includeServerSideToolInvocations unconditionally inside the 'tool_config' object
which causes API 400 errors; modify the code that builds the 'tool_config' (the
object containing function_calling_config) so that
includeServerSideToolInvocations is only added when tool_combination_enabled is
true (e.g., construct tool_config, set function_calling_config always, and
conditionally assign includeServerSideToolInvocations = tool_combination_enabled
only when tool_combination_enabled is truthy).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 3f74bbec-85f2-4f6a-8716-721a7de34178
📒 Files selected for processing (1)
src/code.gs
📜 Review details
🔇 Additional comments (3)
src/code.gs (3)
57-57: Good default for feature flag.Initializing
tool_combination_enabledtofalsekeeps the new behavior opt-in and avoids accidental behavior changes.
306-309: Chainable API addition is consistent.
enableToolCombination(enabled)follows the existing fluent API style and cleanly scopes the flag inChat.
2457-2457: No concern on EOF newline change.No functional impact here.
No description provided.