assessment-artific/back-end
user 2f45d49ac0 Update json endpoint 2024-10-31 16:40:41 +01:00
..
src Update json endpoint 2024-10-31 16:40:41 +01:00
.gitignore initial 2024-10-31 13:00:19 +01:00
README.md initial 2024-10-31 13:00:19 +01:00
poetry.lock update to Python 3.12, fastapi 0.115.4 2024-10-31 16:40:05 +01:00
pyproject.toml update to Python 3.12, fastapi 0.115.4 2024-10-31 16:40:05 +01:00

README.md

Backend Project Task Description

Goal

The goal of this project is to implement a backend service that streams valid versions of JSON objects. So each iteration in the stream should be a valid, parsable json object that complies with a certain definition. The input for your JSON is gathered from a generator that produces the json a few characters at a time (to simulate the behavior of a Large Language Model that is streaming). At each update you get from the generator, you will need to stream a new (valid) version of the json object.

Requirements

  1. The schema of the JSON object is already defined in schema/response.py. Make sure to use this schema for generating the JSON objects.
  2. A generator function for the JSON objects is provided in generators.py. You should use this function to generate the JSON objects.
  3. The backend service should stream the JSON objects character by character, rather than sending the entire JSON object at once.
  4. Each iteration of your stream should send a valid json object.

Additional Considerations

  • Make sure to handle any potential errors or exceptions that may occur during the streaming process.
  • Consider implementing appropriate error handling.