changed reasoning efford to medium to mitigate timeouts processing files
This commit is contained in:
parent
05096065c6
commit
299db221e9
2 changed files with 10 additions and 5 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -6,6 +6,7 @@ BRIEFS_TO_TEST/
|
|||
ARCHIVE/
|
||||
|
||||
venv/
|
||||
*.csv
|
||||
|
||||
# Upload files
|
||||
uploads/
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue