Skip to content

Conversation

@FranciscoMoretti
Copy link
Contributor

Background

This guides shows how to leverage partialObjectStream to stream follow-up suggestions after the main message.

Summary

Added a doc with the guide

Notes

  • Not sure how to make sure docs render correctly. Couldn't find anything in the contribution guide
  • Might need some work related to the scope of code blocks. Happy to iterate on suggestions

sendMessage,
}: {
message: ChatMessage
sendMessage: UseChatHelpers<ChatMessage>['sendMessage']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UseChatHelpers type is used without being imported from the AI SDK, which will cause a TypeScript compilation error.

View Details
📝 Patch Details
diff --git a/content/cookbook/00-guides/06-follow-up-questions.mdx b/content/cookbook/00-guides/06-follow-up-questions.mdx
index 579cd6edd..2d74b9695 100644
--- a/content/cookbook/00-guides/06-follow-up-questions.mdx
+++ b/content/cookbook/00-guides/06-follow-up-questions.mdx
@@ -97,6 +97,7 @@ Create a new file `components/followup-suggestions.tsx`:
 'use client'
 
 import type { ChatMessage } from '@/lib/ai/types'
+import type { UseChatHelpers } from '@ai-sdk/react'
 import { useCallback } from 'react'
 import { Button } from './ui/button'
 import { Separator } from './ui/separator'

Analysis

Missing import for UseChatHelpers type causes TypeScript compilation error

What fails: Component type definitions in content/cookbook/00-guides/06-follow-up-questions.mdx reference UseChatHelpers<ChatMessage>['sendMessage'] on lines 109 and 159 without importing the type from @ai-sdk/react

How to reproduce:

# Run TypeScript compilation on the cookbook file
npx tsc --noEmit content/cookbook/00-guides/06-follow-up-questions.mdx

Result: TypeScript error: "Cannot find name 'UseChatHelpers'"

Expected: Type should be properly imported from @ai-sdk/react package, as confirmed by the AI SDK React source code where UseChatHelpers is exported

Fix: Added import type { UseChatHelpers } from '@ai-sdk/react' to the component imports

@gr2m gr2m added the documentation Improvements or additions to documentation label Sep 22, 2025
@gr2m gr2m requested a review from nicoalbanese September 22, 2025 16:29
@songkeys
Copy link

is streaming via message metadata a better idea for follow-up questions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants