Skip to content

A fun test of the streaming implemented using FastAPI.

License

Notifications You must be signed in to change notification settings

gideont/stream_api

Repository files navigation

FastAPI Streaming Test

Objective

This project is a simple demonstration of streaming capabilities using FastAPI.

Getting Started

These instructions will get you up and running with a FastAPI server that you can interact with using a client script or curl.

Prerequisites

Before you begin, ensure you have the following installed:

  • Python 3.6+
  • FastAPI
  • Uvicorn (ASGI server for FastAPI)

Running the Stream Server

To start the FastAPI server, run the following script:

$ ./go_uvicorn.sh

Using the Stream Client

After starting the server, you can run the stream client to call the stream API, and see each words print out one by one as the stream of story arrives:

$ python get_stream_and_print.py

Testing with Curl

If you prefer to use curl to test the stream, you can use the included script:

$ ./curl.sh

Stopping the Server

When you're done and you want to stop the FastAPI server, use the following script:

$ ./kill_uvicorn.sh

About

A fun test of the streaming implemented using FastAPI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published