diff --git a/.gitignore b/.gitignore index a94f971..4ea0d6e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ BRIEFS_TO_TEST/ ARCHIVE/ venv/ +*.csv # Upload files uploads/ diff --git a/process_brief_enhanced.py b/process_brief_enhanced.py index 4d3e064..7666cc7 100644 --- a/process_brief_enhanced.py +++ b/process_brief_enhanced.py @@ -207,8 +207,12 @@ class DocumentAnalyzer: logging.error("OPENAI_API_KEY not set.") sys.exit(1) try: - logging.info(f"Using OpenAI GPT-5 model with high reasoning effort") - return OpenAI(api_key=OPENAI_API_KEY) + logging.info(f"Using OpenAI GPT-5 model with medium reasoning effort") + # Configure OpenAI client with reduced retries for GPT-5 reasoning + return OpenAI( + api_key=OPENAI_API_KEY, + max_retries=2 # Reduce retries to avoid excessive waiting + ) except Exception as e: logging.error(f"Error configuring OpenAI model: {e}") sys.exit(1) @@ -294,7 +298,7 @@ class DocumentAnalyzer: messages=[ {"role": "user", "content": combined_prompt} ], - reasoning_effort="high", + reasoning_effort="medium", response_format={"type": "json_object"} ) @@ -459,7 +463,7 @@ class DocumentAnalyzer: messages=[ {"role": "user", "content": combined_prompt} ], - reasoning_effort="high", + reasoning_effort="medium", response_format={ "type": "json_schema", "json_schema": OPENAI_ASSET_SCHEMA @@ -534,7 +538,7 @@ class DocumentAnalyzer: messages=[ {"role": "user", "content": combined_prompt} ], - reasoning_effort="high", + reasoning_effort="medium", response_format={ "type": "json_schema", "json_schema": OPENAI_ASSET_SCHEMA