Large Language Models (LLMs) has recently opened a new breadth of possibilities in terms of generating Natural Language content following instructions. Two uses of this technology are highlighted in this project, the first one enables to write an initial report from some given data and an example and the second one gives the possibility to chat directly with the LLM to edit and improve the initial version of the report.

# Simple Prompting

The initial creation of the report happens in the flow, leveraging the [Prompt Recipe and the Prompt Studio](https://knowledge.dataiku.com/latest/ml-analytics/gen-ai/concept-prompt-studio.html) from Dataiku. They connect to a LLM configured in the connections and allows to experiment on some prompts and then apply it on a dataset. Hence, the user is able to leverage the power of LLMs in a complete no-code approach.

The prompt provides instructions to the LLM along with an example of the expected output and the data needed to generate this output. This technique can be improved using few-shots context learning, where a series of pairs input-output are given to the LLM in the context window.

# Chat

These LLMs also allow to interact through a chat interface. This is what is displayed in the webapp where the user can edit iteratively edit the report through instructions. Depending on the size of the context window, a more or less long history can be kept in memory to answer the instructions as well as possible.

This feature was developed using code and connecting to one of the LLM configured in the connections in an technology-agnostic way. It leverages the development framework described [here](https://developer.dataiku.com/latest/tutorials/webapps/code-studio/index.html).