# Install Google Generative AI library !pip install google-generativeai # Import the library import google.generativeai as genai # Initialize the Google Gemini model genai.configure(api_key="YOUR API KEY ") # Set your API key here model = genai.GenerativeModel("gemini-1.5-flash") # Now let's retrieve and combine the context (similar to your earlier steps) retrieved_text = "\n".join([doc.page_content for doc in retrieved_docs]) # Create a question prompt using the context and your query prompt = f"Based on the following information, please provide the answer to: {query}\n\n{retrieved_text}" # Generate an answer using the model (use the generate_content method) response = model.generate_content(prompt) # Output the response generated by Google Gemini print("LLM Response:", response.text) __ __