alanchen1115 commited on
Commit
371da96
·
verified ·
1 Parent(s): 8a9ff95

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -2
main.py CHANGED
@@ -21,9 +21,12 @@ for filename in files:
21
  pdf_content+= page.extract_text()
22
 
23
  # 設定生成文字的參數 + 角色扮演
 
 
 
24
  generation_config = genai.types.GenerateContentConfig(max_output_tokens=3000, temperature=0.1, top_p=0.2,
25
- system_instruction=pdf_content+"\n"+
26
- "您是一位問答助手。請僅限使用以上提供的內容來回答問題。如果您不知道答案,請說您不知道,不要捏造答案。")
27
 
28
  # 設定 Line Bot 的 API 金鑰和秘密金鑰
29
  line_bot_api = LineBotApi(os.environ["CHANNEL_ACCESS_TOKEN"])
 
21
  pdf_content+= page.extract_text()
22
 
23
  # 設定生成文字的參數 + 角色扮演
24
+ system_instruction = pdf_content+"\n"+
25
+ "您是一位問答助手。請僅限使用以上提供的內容來回答問題。如果您不知道答案,請說您不知道,不要捏造答案。"
26
+ thinking_config = genai.types.ThinkingConfig(thinking_budget=0) # thinking_budget = 0, turn off thinking mode
27
  generation_config = genai.types.GenerateContentConfig(max_output_tokens=3000, temperature=0.1, top_p=0.2,
28
+ thinking_config=thinking_config,
29
+ system_instruction=system_instruction)
30
 
31
  # 設定 Line Bot 的 API 金鑰和秘密金鑰
32
  line_bot_api = LineBotApi(os.environ["CHANNEL_ACCESS_TOKEN"])