from _openai import OpenAI from _arango import ArangoDB arango = ArangoDB() openai = OpenAI() speeches = list(arango.all_ev_speeches()) env_against = [] for speech in speeches: if 'Environmental Concerns During Production' in speech["normalized_arguments"]: env_against.append((speech['name'], speech['text'])) s = '' for name, text in env_against: s += f'{name.upper()}:\n{text}\n\n' prompt = f"""The following politicians have expressed concerns about the environmental impact of electric vehicle production, particularly regarding "Environmental Concerns During Production". I'm interested in how they argues around CO2 emissions. Could you provide me with some insights? Please answer the following question:\n - What is the biggest concern around electric cars? - How often are they mentioning CO2 emissions? - What argumentation do they use to argue against electric cars if they mention CO2 emissions? - Are they relating to the CO2 budget defined by the United Nations? Please answer in a structured way and provide as much detail as possible. Also, include examples from the speeches if possible. Keep to the information provided in the speeches! """ answer = openai.generate(prompt) print(answer)