File size: 1,089 Bytes
325b400
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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()