Skip to content
Discussion options

You must be logged in to vote

Hey @JorgeRui - I'm running this exact stack in production (Prism + Vercel AI SDK v6 + Laravel + Inertia/React), so hopefully this helps clear things up.

The Key Insight

Prism's asDataStreamResponse() speaks the exact same data stream protocol that the Vercel AI SDK expects. So the wiring is actually straightforward once you know the pieces.

Backend: The Controller

The AI SDK sends a messages array where each message has a role and parts array. You don't need to process the full message history on every request — just extract what you need from the latest message:

class StreamChatController extends Controller
{
    public function __construct(
        protected Iris $iris,
        protected 

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@JorgeRui
Comment options

@sixlive
Comment options

Answer selected by JorgeRui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants