SHORT STORIES GENERATOR
LLMLangChainPrompt EngineeringText to SpeechStreamlit
CONTEXT AND OBJECTIVE
Building applications with LLMs by using them as a chain of components is an interesting and promising approach. LangChain is a framework that can be used to that end.
The goal of this project was to explore some of the possibilities offered by LangChain, building on OpenAI’s latest model (ChatGPT-4o). It showcases how an LLM can be invoked to generate a specific output, and then invoked again, with a different role, to build on the output of the first step.
WHAT WAS DONE
Using LangChain Python library, a web app was developped with Streamlit. Using ChatGPT-4o via API, the app generates short stories based on the genre selected by the user and taking into account the desired length. The story can be translated from English to another language, which is realized behind the scene by using ChatGPT a second time, as a text translator. Optionally, the user can convert the generated text to audio, thanks to OpenAI “tts-1” text-to-speech model.
The source code is available on GitHub.