in functions/main.py [0:0]
def get_genai_follow_up_questions(prompt, grounding_attributions):
context = "Given a developer just asked " + prompt
for item in grounding_attributions:
context = add_custom_instruction_to_context(
context, item.content.parts[0].text
)
new_condition = "Read the context below and answer the user's question at the end."
new_context_with_instruction = add_custom_instruction_to_context(
new_condition, context
)
new_question = (
"What are 3 questions developers might ask after reading the context above?"
)
new_response = markdown.markdown(
ask_model_with_context(
new_context_with_instruction, new_question
)
)
related_questions = parse_related_questions_response_to_list(new_response)
return related_questions