File size: 860 Bytes
58a3adb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72118cd
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
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:

1. **Text Streaming Endpoint (`/v1/test_text`)** - Streams text word by word in Server-Sent Events (SSE) format.
2. **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**
```sh
curl -X POST "https://ariansyahdedy-frontend-test.hf.space/v1/test_text" -H "Accept: text/event-stream"
```

### **Chart & Text Streaming**
```sh
curl -X POST "https://YOUR_USERNAME-fastapi-streaming.hf.space/v1/test_chart" -H "Accept: text/event-stream"
```