This Cloudflare Worker is part of the LearnWhy project developed for the Cloudflare AI Challenge.
This Cloudflare Worker handles the generation of real-world stories in response to user input from the LearnWhy application. It leverages the llama-2-7b-chat-fp16 model to craft narratives that highlight the necessity of understanding complex scientific concepts.
- Receive User Input: The worker receives text input from the LearnWhy frontend, expressing the user's struggles with understanding scientific topics.
- Generate Story: Utilizing the llama-2-7b-chat-fp16 model, the worker generates a real-world story that illustrates the importance of the identified concept.
- Return Story: The generated story is returned as a response to the frontend, ready to be presented to the user.
{
"query": "The user input (frontend prompt)"
}
{
"response": "The story generated"
}
- Clone this repository.
- Install dependencies using npm:
npm install
- Deploy the worker to your Cloudflare account using Wrangler:
wrangler publish