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 with
  • user_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:

  1. All these base values are set with the CLI and saved in our promt_data object.
  2. 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 the internet_search module if they are activated.

Enhancements with Modules

include_project:

  1. Embed the source_code.txt and user_message.txt into the RAG
  2. Extract closely related IDs
  3. Transform their content back into plain text with the embedding model
  4. Add this as context

internet_search:

  1. Uses KBERT to extract relevant keywords from source_code.txt and user_message.txt
  2. Perform targeted web searches
  3. Clean findings
  4. Add this as context