diff --git a/backend/app/services/pdf_generator.py b/backend/app/services/pdf_generator.py index 4c2b3e88..9e4acd8b 100644 --- a/backend/app/services/pdf_generator.py +++ b/backend/app/services/pdf_generator.py @@ -36,11 +36,13 @@ class PDFGenerator: root_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(current_file)))) # Try Noto Serif TC first (best Chinese support) + # Use static font instead of variable font for better ReportLab compatibility noto_font_path = os.path.join( root_dir, 'Cactus_Classical_Serif,Noto_Serif_TC', 'Noto_Serif_TC', - 'NotoSerifTC-VariableFont_wght.ttf' + 'static', + 'NotoSerifTC-Regular.ttf' # Use static Regular instead of Variable font ) print(f"Attempting to load Noto Serif TC from: {noto_font_path}") diff --git a/tradingagents/dataflows/openai.py b/tradingagents/dataflows/openai.py index 6f182c43..1a93d460 100644 --- a/tradingagents/dataflows/openai.py +++ b/tradingagents/dataflows/openai.py @@ -42,7 +42,7 @@ def get_stock_news_openai(query, start_date, end_date): "search_context_size": "low", } ], - temperature=0.7, # Reduced from 1.0 to prevent character errors like '煉' and stabilize output + temperature=0.5, # Reduced to 0.5 for maximum accuracy and consistency max_output_tokens=4096, top_p=1, store=True, @@ -90,7 +90,7 @@ def get_global_news_openai(curr_date, look_back_days=7, limit=5): "search_context_size": "low", } ], - temperature=0.7, # Reduced from 1.0 to prevent character errors and stabilize output + temperature=0.5, # Reduced to 0.5 for maximum accuracy and consistency max_output_tokens=4096, top_p=1, store=True, @@ -137,7 +137,7 @@ def get_fundamentals_openai(ticker, curr_date): "search_context_size": "low", } ], - temperature=0.7, # Reduced from 1.0 to prevent character errors and stabilize output + temperature=0.5, # Reduced to 0.5 for maximum accuracy and consistency max_output_tokens=4096, top_p=1, store=True,