Feat/ai-groq-summarize#837
Conversation
- Added `groqSummarize` and `createGroqSummarize` functions for summarization capabilities. - Updated `package.json` to use `tsx` for running the documentation verification script. - Enhanced documentation for the Groq adapter to include summarization examples and usage. - Updated tests to validate the new summarization functionality and ensure proper integration with existing features. - Modified configuration files to reflect the addition of summarization support. This commit enhances the Groq integration by providing tree-shakeable summarization adapters, aligning with patterns used by other providers.
Replaced the command for the documentation verification script in package.json from `node` to `tsx` for improved execution. This change aligns with recent updates to enhance script performance and compatibility.
📝 WalkthroughWalkthroughAdds Groq summarize factories and exports for ChangesGroq summarize support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 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)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/config.json`:
- Around line 443-444: The Groq entry’s metadata is stale: update the updatedAt
value in docs/config.json for the affected entry from the older date to the
current docs change date. Use the existing entry fields around addedAt/updatedAt
to locate the record, and keep the updatedAt timestamp aligned with the content
change while leaving the rest of the metadata unchanged.
In `@testing/e2e/src/routes/api.summarize.ts`:
- Around line 50-54: The Groq e2e setup is overriding the adapter’s default
endpoint and missing the required /openai/v1 path, so requests are going to the
wrong route. Update the groq configuration in api.summarize.ts so
createGroqSummarize still uses llmockBase(aimockPort) but with the Groq-specific
/openai/v1 suffix, ensuring the adapter targets /openai/v1/chat/completions
instead of the root /chat/completions path.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 93c8d147-485d-41d5-806c-278babe3ce70
📒 Files selected for processing (11)
.changeset/groq-summarize-adapter.mddocs/adapters/groq.mddocs/config.jsonpackage.jsonpackages/ai-groq/README.mdpackages/ai-groq/src/adapters/summarize.tspackages/ai-groq/src/index.tspackages/ai-groq/tests/groq-adapter.test.tspackages/ai/tests/summarize-max-length.test.tstesting/e2e/src/lib/feature-support.tstesting/e2e/src/routes/api.summarize.ts
| "addedAt": "2026-04-15", | ||
| "updatedAt": "2026-06-18" |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Refresh the Groq entry’s updatedAt.
2026-06-18 looks stale for this docs change; please bump it to 2026-06-25 so the navigation metadata stays accurate.
As per coding guidelines, docs/config.json entries must update updatedAt when making content changes.
🛠️ Suggested fix
- "updatedAt": "2026-06-18"
+ "updatedAt": "2026-06-25"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "addedAt": "2026-04-15", | |
| "updatedAt": "2026-06-18" | |
| "addedAt": "2026-04-15", | |
| "updatedAt": "2026-06-25" |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/config.json` around lines 443 - 444, The Groq entry’s metadata is stale:
update the updatedAt value in docs/config.json for the affected entry from the
older date to the current docs change date. Use the existing entry fields around
addedAt/updatedAt to locate the record, and keep the updatedAt timestamp aligned
with the content change while leaving the rest of the metadata unchanged.
Source: Coding guidelines
| groq: () => | ||
| createGroqSummarize('llama-3.3-70b-versatile', DUMMY_KEY, { | ||
| baseURL: llmockBase(aimockPort), | ||
| defaultHeaders: headers, | ||
| }), |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Inspect how GroqTextAdapter builds its request URL from baseURL/config
fd -t f . packages/ai-groq/src -e ts | xargs rg -nC3 'baseURL|/v1|chat/completions|new URL|fetch\('
# Compare with grok adapter URL construction
fd -t f . packages/ai-grok/src -e ts | xargs rg -nC3 'baseURL|/v1|chat/completions'Repository: TanStack/ai
Length of output: 20493
Ensure Groq e2e tests target the /openai/v1 endpoint path
The Groq adapter expects endpoints under /openai/v1, distinct from the standard /v1 used by OpenAI and Grok. The withGroqDefaults utility only injects the correct default if baseURL is absent; since the e2e test explicitly passes baseURL: llmockBase(aimockPort), the adapter uses that root path directly, resulting in requests to /chat/completions instead of the required /openai/v1/chat/completions.
Update the configuration to append the Groq-specific path:
// testing/e2e/src/routes/api.summarize.ts
groq: () =>
createGroqSummarize('llama-3.3-70b-versatile', DUMMY_KEY, {
baseURL: `${llmockBase(aimockPort)}/openai/v1`,
defaultHeaders: headers,
}),🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@testing/e2e/src/routes/api.summarize.ts` around lines 50 - 54, The Groq e2e
setup is overriding the adapter’s default endpoint and missing the required
/openai/v1 path, so requests are going to the wrong route. Update the groq
configuration in api.summarize.ts so createGroqSummarize still uses
llmockBase(aimockPort) but with the Groq-specific /openai/v1 suffix, ensuring
the adapter targets /openai/v1/chat/completions instead of the root
/chat/completions path.
Replaced the command for the documentation verification script in package.json from
nodetotsxfor improved execution. This change aligns with recent updates to enhance script performance and compatibility.🎯 Changes
✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores