-
Notifications
You must be signed in to change notification settings - Fork 15
feat: add comprehensive chatbot tutorial with pgflow and AI SDK #596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add a new tutorial showing how to build a production-ready chatbot that: - Uses pgflow to orchestrate multi-step context gathering - Performs parallel retrieval from 3 sources (semantic search, web search, memory) - Implements merge and reranking of results - Streams responses using AI SDK's useChat hook - Shows real-time progress updates via pgflow client The tutorial demonstrates: - Multi-step flow with parallel execution - Browser client integration with real-time progress - Edge function for SSE chat streaming - Separation of context gathering from response streaming - Complete database schema, task implementations, and flow definition Tutorial added to sidebar navigation in astro.config.mjs
|
|
View your CI Pipeline Execution ↗ for commit 6b734f7
☁️ Nx Cloud last updated this comment at |
| transform(chunk, controller) { | ||
| const text = new TextDecoder().decode(chunk); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creates a new TextDecoder for each chunk, which will corrupt multi-byte UTF-8 characters that span across chunks. The decoder should be created once outside the transform function and reused with the stream: true option.
const decoder = new TextDecoder();
const transformStream = new TransformStream({
transform(chunk, controller) {
const text = decoder.decode(chunk, { stream: true });
fullResponse += text;
controller.enqueue(chunk);
},
flush: async () => {
// Finalize any remaining bytes
fullResponse += decoder.decode();
await supabase
.from('messages')
.insert({
conversation_id: conversationId,
role: 'assistant',
content: fullResponse,
});
},
});Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
Fix broken links in Next Steps section: - /build/flows/ → /concepts/understanding-flows/ - /concepts/tasks/ → /build/create-reusable-tasks/
🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-596.pgflow.pages.dev 📝 Details:
_Last updated: _ |
Add a new tutorial showing how to build a production-ready chatbot that:
The tutorial demonstrates:
Tutorial added to sidebar navigation in astro.config.mjs