Skip to content

docs(ai-groq,ai-grok,ai-mistral): fix README examples importing nonexistent generate/generateImages - #1957

Open
pcbeingused333 wants to merge 1 commit into
TanStack:mainfrom
pcbeingused333:docs/readme-fix-generate-imports
Open

pcbeingused333 wants to merge 1 commit into
TanStack:mainfrom
pcbeingused333:docs/readme-fix-generate-imports

Conversation

@pcbeingused333

@pcbeingused333 pcbeingused333 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Changes

The usage examples in the @tanstack/ai-groq, @tanstack/ai-grok and @tanstack/ai-mistral READMEs import generate from @tanstack/ai (and generateImages in the Grok image example). @tanstack/ai exports neither, so the examples fail as written.

  • Text examples now use chat({ adapter, threadId, stream: false, messages }), the non-streaming form documented for chat(); result.text is unchanged.
  • The Grok image example now uses generateImage, passes the model to grokImage('grok-imagine-image-2.0') (its signature takes the model) and adds threadId.
  • Dropped the stray model: option from the Groq and Mistral examples; the model comes from the adapter.
  • Patch changeset for the three packages, since their READMEs ship with the package.

No runtime code is touched. The snippets were checked against the names exported from packages/ai/src/index.ts and the adapter signatures; they were not run against the provider APIs. docs/ is not changed because the broken examples only exist in these package READMEs.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.
  • Docs: I updated docs/ for this change, or this change is not user-facing.
  • Changeset: I added a changeset (pnpm changeset), or this PR does not change a published package.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Disclosure: this change was prepared with the assistance of Claude, an AI coding agent.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated Groq, Grok, and Mistral text and chat examples to use chat with non-streaming responses and thread IDs.
    • Updated Grok image-generation examples to use generateImage, with the model configured through the adapter.
    • Removed outdated generate and generateImages usage from the affected examples.

…istent generate/generateImages

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bb24240

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@tanstack/ai-groq Patch
@tanstack/ai-grok Patch
@tanstack/ai-mistral Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: TanStack/ai
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 3ce3085
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c1edea5e-ec47-49bd-9a05-022938d0e332
Commits

Reviewing files that changed from the base of the PR and between 3ce3085 and bb24240.

Files selected for processing: 4
  • .changeset/readme-fix-generate-imports.md
  • packages/ai-grok/README.md
  • packages/ai-groq/README.md
  • packages/ai-mistral/README.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

The Groq, Grok, and Mistral README examples now use updated chat API calls. The Grok image-generation example also uses an updated API call. A changeset declares patch releases for the three packages.

Changes: Provider README Updates

Layer / File(s) Summary
Chat examples and release entries
.changeset/readme-fix-generate-imports.md, packages/ai-grok/README.md, packages/ai-groq/README.md, packages/ai-mistral/README.md
The chat examples use chat, add a thread ID, and set stream: false. The changeset declares patch releases for the three packages.
Grok image-generation example
packages/ai-grok/README.md
The example uses generateImage, passes the model to grokImage, and adds a thread ID.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: alemtuzlak

Merge Risk: Minimal · up to bb242

The README examples and release metadata match the supported APIs, with no merge-blocking risk identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the README documentation fixes and the invalid generate/generateImages imports in the three affected packages.
Description check Passed The description includes all required sections, explains the changes and release impact, documents the changeset, and addresses why docs were not changed. Some checklist items remain unchecked, but th…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description includes all required sections, explains the changes and release impact, documents the changeset, and addresses why docs were not changed. Some checklist items remain unchecked, but the description is otherwise complete.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (4 skipped: 4 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the PR, @pcbeingused333! 🙌 @tombeckenham will take a look.

Automated pre-review checks

  • ✅ CI passing
  • ✅ No merge conflicts
  • ✅ Changeset present
  • ✅ E2E test changes included

Automated triage — a human review follows.

@github-actions github-actions Bot added the waiting-on: maintainer The ball is in the maintainers’ court label Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-on: maintainer The ball is in the maintainers’ court

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants