Slide 22
Slide 22 text
取得したデータを背景に、 LLM に生成リクエスト
Cloud Run Vertex AI
Python の例
history = []
for snapshot in vector_query.get():
text_chunk = snapshot.get("chunk")
history.append(Content(role="model", parts=[Part.from_text(text_chunk)]))
history.append(Content(role="user", parts=[Part.from_text(query.query)]))
responses = generation_model.generate_content(
contents=history,
generation_config={
"max_output_tokens": 8192,
"temperature": 1,
"top_p": 0.95,
},
)