Prompt Design - amosproj/amos2025ss04-ai-driven-testing GitHub Wiki
Our prompt consist of 4 parts, the source_code.txt
, the user_message.txt
, the system message and additional context.
Base case:
source_code.txt
: Contains Python code that we want to work withuser_message.txt
: Holds instructions specifying what actions to perform with the code, like writing unit-tests or editing something- system message: This sets the role (
a helpful assistant
) and the output-format (Markdown code
)
Process:
- All these base values are set with the CLI and saved in our
promt_data
object. - Once the Model is loaded, the prompt is efficiently pieced together and the remaining space for the context is filled with information form the
include_project
module or theinternet_search
module if they are activated.
Enhancements with Modules
include_project
:
- Embed the
source_code.txt
anduser_message.txt
into the RAG - Extract closely related IDs
- Transform their content back into plain text with the embedding model
- Add this as context
internet_search
:
- Uses KBERT to extract relevant keywords from
source_code.txt
anduser_message.txt
- Perform targeted web searches
- Clean findings
- Add this as context