Update GPT settings for gpt-5.5

This commit is contained in:
Hiroaki86
2026-06-06 20:46:28 +09:00
parent cc17fe2e04
commit e3fb298b82
14 changed files with 108 additions and 29 deletions
+8 -3
View File
@@ -22,7 +22,9 @@ YOUR_API_KEY = os.getenv("OPENAI_API_KEY")
if YOUR_API_KEY is None:
raise RuntimeError("OPENAI_API_KEY が環境変数に設定されていません。")
gpt_model = "gpt-5.4"
gpt_model = "gpt-5.5"
reasoning_effort = os.getenv("OPENAI_REASONING_EFFORT", "low")
text_verbosity = os.getenv("OPENAI_TEXT_VERBOSITY", "low")
# =========================
# 入出力ファイル
@@ -355,7 +357,8 @@ def call_gpt(client, model, system_content: str, user_text: str, images_data_url
{"role": "system", "content": system_content},
{"role": "user", "content": content_parts},
],
temperature=0.0,
reasoning={"effort": reasoning_effort},
text={"verbosity": text_verbosity},
max_output_tokens=max_output_tokens,
)
return resp.output_text or ""
@@ -440,6 +443,8 @@ def write_debug_entry(
f.write("=" * 60 + "\n")
f.write(f"DEBUG TIME : {_now_str()}\n")
f.write(f"MODEL : {gpt_model}\n")
f.write(f"REASONING : {reasoning_effort}\n")
f.write(f"VERBOSITY : {text_verbosity}\n")
f.write(f"TIMEFRAME : {timeframe}\n")
f.write(f"TREND_STATE(H4) : {trend_state} (0=RANGE,1=UP,2=DOWN)\n")
f.write(f"SELECTED_STRATEGY : {','.join(str(x) for x in selected_strategies)}\n")
@@ -627,4 +632,4 @@ def _write_outputs(numeric_list):
# 実行
# =========================
if __name__ == "__main__":
run_pipeline()
run_pipeline()
+8 -3
View File
@@ -22,7 +22,9 @@ YOUR_API_KEY = os.getenv("OPENAI_API_KEY")
if YOUR_API_KEY is None:
raise RuntimeError("OPENAI_API_KEY が環境変数に設定されていません。")
gpt_model = "gpt-5.4"
gpt_model = "gpt-5.5"
reasoning_effort = os.getenv("OPENAI_REASONING_EFFORT", "low")
text_verbosity = os.getenv("OPENAI_TEXT_VERBOSITY", "low")
# =========================
# 入出力ファイル
@@ -62,6 +64,8 @@ def write_debug_trend(path: str, current_price: float, numeric_summary: str, gpt
f.write("=" * 60 + "\n")
f.write(f"DEBUG TIME : {_now_str()}\n")
f.write(f"MODEL : {gpt_model}\n")
f.write(f"REASONING : {reasoning_effort}\n")
f.write(f"VERBOSITY : {text_verbosity}\n")
f.write(f"CURRENT PRICE : {current_price:.2f}\n")
f.write("=" * 60 + "\n\n")
f.write("---- NUMERIC SUMMARY START ----\n")
@@ -289,7 +293,8 @@ def call_gpt_trend(client, model, system_content: str, user_text: str, image_dat
{"role": "system", "content": system_content},
{"role": "user", "content": content_parts},
],
temperature=0.0,
reasoning={"effort": reasoning_effort},
text={"verbosity": text_verbosity},
max_output_tokens=max_output_tokens,
)
return (resp.output_text or "").strip()
@@ -485,4 +490,4 @@ def run_pipeline():
# 実行
# =========================
if __name__ == "__main__":
run_pipeline()
run_pipeline()