kltn21110's picture
Upload 239 files
325b400 verified
import os
import google.generativeai as genai
genai.configure(api_key="AIzaSyD2hh16UhUIX7AbtW52_7o4VP7x5ieh99U")
def generate_step( query):
generation_config = {
"temperature": 0.7,
"top_p": 0.95,
"top_k": 40,
"max_output_tokens": 12000,
"response_mime_type": "text/plain",
}
model = genai.GenerativeModel(
model_name="gemini-2.0-flash-thinking-exp-01-21",
generation_config=generation_config,
)
chat_session = model.start_chat(
history=[
{
"role": "user",
"parts": [
f"""
{query}
"""
],
}
]
)
response = chat_session.send_message("Hãy thực hiện theo đúng yêu cầu của mình. Trình bày rõ ràng các yêu cầu lấy dữ liệu để phân tích trong thẻ <step_data> và các bước thực hiện trong thẻ <step>. Hãy trình bày rõ ràng các yêu cầu lấy dữ liệu theo cấu trúc mẫu sau:")
return response.text.strip()