Spaces:
Sleeping
Sleeping
metadata
title: FastAPI Streaming API
emoji: π
colorFrom: blue
colorTo: green
sdk: docker
pinned: false
FastAPI Streaming API
This Hugging Face Space hosts a FastAPI backend that provides two endpoints:
- Text Streaming Endpoint (
/v1/test_text
) - Streams text word by word in Server-Sent Events (SSE) format. - Chart & Text Streaming Endpoint (
/v1/test_chart
) - Streams a Base64-encoded chart followed by text data.
Deployment Instructions
This Space is containerized using Docker. It runs a FastAPI application on port 7860
.
Example Usage
Text Streaming
curl -X POST "https://ariansyahdedy-frontend-test.hf.space/v1/test_text" -H "Accept: text/event-stream"
Chart & Text Streaming
curl -X POST "https://YOUR_USERNAME-fastapi-streaming.hf.space/v1/test_chart" -H "Accept: text/event-stream"