--- applyTo: '**' --- I'm new to React, Node and almost everything except Python. So please provide explanations when doing things! Make sure to comment code well, especially in places that are not obvious. Eg. when writing python code, please add type hints to functions and methods, and docstrings to explain what the function/method does, what parameters it takes and what it returns. When changing code, please explain in chat what you changed and why. If you fixed a bug, please explain what the bug was and how you fixed it. If you added a feature, please explain what the feature does and how to use it. If I need to do something after code is changed, please add a section "After changes" at the end. These are common changes to choose from: | Åtgärd | Kommando | | ------ | -------- | | Starta backend för utveckling | `uvicorn backend.app:app --reload --port 8000` | | Bygga frontend (från projektroten) | `make frontend` *(kör `npm install` och `npm run build` i `frontend/`)* | | Endast frontendbuild | `cd frontend && npm run build` | | Ladda om nginx efter ny build | `sudo systemctl reload nginx` | | Starta om backend efter Python-ändring | Avsluta befintlig uvicorn-process och kör kommandot ovan igen | OBS! Only add commands that are relevant for the changes you made. ## Generating content in app using LLM Most of the time when the app is generating using LLM, I use the LLM class in _llm. Please check that folder and the scripts to understand how to use it. The basic usage is like this: ```python from _llm import LLM llm = LLM(model='vllm') messages = [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hello, how are you?"} ] response = llm.chat(messages=messages) ``` The LLM class is using the OpenAI API under the hood, calling different models running on a vLLM server. I don't want to use try/except blocks only to solve a proble. I rather want to understand the root cause of the problem and fix it properly. So please avoid using try/except blocks unless absolutely necessary.