Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/readme-fix-generate-imports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@tanstack/ai-groq': patch
'@tanstack/ai-grok': patch
'@tanstack/ai-mistral': patch
---

Fix the README usage examples: they imported `generate` (and `generateImages` for Grok) from `@tanstack/ai`, which do not exist. They now use `chat({ stream: false })` and `generateImage`.
14 changes: 8 additions & 6 deletions packages/ai-grok/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ export XAI_API_KEY="xai-..."

```typescript
import { grokText } from '@tanstack/ai-grok'
import { generate } from '@tanstack/ai'
import { chat } from '@tanstack/ai'

const adapter = grokText('grok-build-0.1')

const result = await generate({
const result = await chat({
adapter,
threadId: 'thread-1',
stream: false,
messages: [
{ role: 'user', content: 'Explain quantum computing in simple terms' },
],
Expand Down Expand Up @@ -82,13 +84,13 @@ console.log(result.summary)

```typescript
import { grokImage } from '@tanstack/ai-grok'
import { generateImages } from '@tanstack/ai'
import { generateImage } from '@tanstack/ai'

const adapter = grokImage()
const adapter = grokImage('grok-imagine-image-2.0')

const result = await generateImages({
const result = await generateImage({
adapter,
model: 'grok-imagine-image-2.0',
threadId: 'thread-1',
prompt: 'A beautiful sunset over mountains',
numberOfImages: 1,
size: '16:9',
Expand Down
7 changes: 4 additions & 3 deletions packages/ai-groq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ export GROQ_API_KEY="gsk_..."

```typescript
import { groqText } from '@tanstack/ai-groq'
import { generate } from '@tanstack/ai'
import { chat } from '@tanstack/ai'

const adapter = groqText('openai/gpt-oss-120b')

const result = await generate({
const result = await chat({
adapter,
model: 'openai/gpt-oss-120b',
threadId: 'thread-1',
stream: false,
messages: [
{ role: 'user', content: 'Explain quantum computing in simple terms' },
],
Expand Down
7 changes: 4 additions & 3 deletions packages/ai-mistral/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ export MISTRAL_API_KEY="..."

```typescript
import { mistralText } from '@tanstack/ai-mistral'
import { generate } from '@tanstack/ai'
import { chat } from '@tanstack/ai'

const adapter = mistralText('mistral-large-latest')

const result = await generate({
const result = await chat({
adapter,
model: 'mistral-large-latest',
threadId: 'thread-1',
stream: false,
messages: [
{ role: 'user', content: 'Explain quantum computing in simple terms' },
],
Expand Down