PhloTour
EN NL
25 / 30

AI streaming

Stream an answer token by token over a single response.

Read the docs →
.phlo
// stream tokens with state: false, sync state once on the final apply()
route async POST chat ask {
	foreach (%Claude->stream(user: %payload->q) AS $tok){
		chunk(append: ['#answer' => $tok->text], state: false)
	}
	apply(class: ['#answer' => '-typing'])
}
		
YouHow does Phlo stream an answer?
Phlo