def context_former(): return """ Below is a snippet of one or several meeting transcripts that center around the question of interest. Write a response that appropriately completes the request. - Utilize transcript(s) for detailed information. - Stick to transcript and do not incorporate preexisting knowledge to enhance response. - State reasoning behind your decisions. ### Transcript: {} """ def format_prompt(user_query, context): prompt = [ {"role": "system", "content": context_former().format(context)}, {"role": "user", "content": user_query}, ] return prompt def prompt_template_alpaca(): return """Below is a query about a meeting and a snippet of a meeting transcript. Write a response that appropriately completes the request. - Utilize transcript for detailed information. - Stick to transcript and do not incorporate preexisting knowledge to enhance response. - State reasoning behind your decisions. ### Query: {} ### Transcript: {} ### Response: {}""" def format_prompt_alpaca(user_query, context): prompt = prompt_template().format(user_query, context, "") return prompt