= """ Given the data, convert the population by age into a CSV format with the following columns: {columns} # requirements: {requirements} # data: {data} """ data_to_csv_prompt = PromptTemplate(input_variables=["columns", "requirements", "data"], template=template) from langchain.chat_models import ChatOpenAI from langchain.schema import HumanMessage chat = ChatOpenAI(temperature=0) columns = """ - age - male - female - total """ requirements = """ Output data from 0 to 108 years old """ result = chat([HumanMessage(content=data_to_csv_prompt2.forma t(columns=columns, requirements=requirements, data=compressed_text))]) print(result.content) age,male,female,total 0,149,143,292 1,133,148,281 2,148,163,311 3,175,171,346 4,177,159,336 5,176,164,340 6,177,158,335 7,186,187,373 8,176,160,336 9,197,193,390 10,197,173,370 11,171,180,351 12,200,194,394 13,197,198,395 14,215,199,414 15,220,197,417 ... 105,0,1,1 106,0,0,0 107,0,1,1 108,0,1,1 プロンプトは基本的に英語で 具体的にどのようなデータを 抽出して欲しいか書く