Streaming
Aprende cómo funciona el streaming en Flowise
Usando la Biblioteca Python/TS
from flowise import Flowise, PredictionData
def test_streaming():
client = Flowise()
# Prueba de predicción con streaming
completion = client.create_prediction(
PredictionData(
chatflowId="<chatflow-id>",
question="¡Cuéntame un chiste!",
streaming=True
)
)
# Procesa e imprime cada fragmento transmitido
print("Respuesta en streaming:")
for chunk in completion:
# {event: "token", data: "hola"}
print(chunk)
if __name__ == "__main__":
test_streaming()Evento
Descripción
Aplicación Streamlit
Last updated