diff --git a/real_intent/analyze/insights/many.py b/real_intent/analyze/insights/many.py index 2d51d50..818f3c5 100644 --- a/real_intent/analyze/insights/many.py +++ b/real_intent/analyze/insights/many.py @@ -81,8 +81,8 @@ def _analyze(self, pii_md5s: list[MD5WithPII]) -> str: @retry_with_backoff() def generate_insights(): - return self.openai_client.beta.chat.completions.parse( - model="gpt-4o-mini", + return self.openai_client.chat.completions.parse( + model="gpt-5-mini", messages=[ { "role": "system", @@ -93,11 +93,7 @@ def generate_insights(): "content": csv_data } ], - max_tokens=4095, - temperature=1, top_p=1, - frequency_penalty=0, - presence_penalty=0, response_format=LeadInsights ) @@ -257,8 +253,8 @@ def _analyze(self, pii_md5s: list[MD5WithPII]) -> str: @retry_with_backoff() def generate_insights(): - return self.openai_client.beta.chat.completions.parse( - model="gpt-4o-mini", + return self.openai_client.chat.completions.parse( + model="gpt-5-mini", messages=[ { "role": "system", @@ -273,11 +269,7 @@ def generate_insights(): ) } ], - max_tokens=4095, - temperature=1, top_p=1, - frequency_penalty=0, - presence_penalty=0, response_format=ValidatedLeadInsights ) diff --git a/real_intent/analyze/insights/per_lead.py b/real_intent/analyze/insights/per_lead.py index 422d58f..09fee0f 100644 --- a/real_intent/analyze/insights/per_lead.py +++ b/real_intent/analyze/insights/per_lead.py @@ -89,8 +89,8 @@ def _analyze_one(self, pii_md5: MD5WithPII) -> LeadInsight: @retry_with_backoff() def generate_insight(): - return self.openai_client.beta.chat.completions.parse( - model="gpt-4o-mini", + return self.openai_client.chat.completions.parse( + model="gpt-5-mini", messages=[ { "role": "system", @@ -105,11 +105,7 @@ def generate_insight(): ) } ], - max_tokens=2000, - temperature=1, top_p=1, - frequency_penalty=0, - presence_penalty=0, response_format=LeadInsight ) diff --git a/real_intent/deliver/followupboss/ai_fields.py b/real_intent/deliver/followupboss/ai_fields.py index 75ea57a..89b707b 100644 --- a/real_intent/deliver/followupboss/ai_fields.py +++ b/real_intent/deliver/followupboss/ai_fields.py @@ -278,7 +278,7 @@ def _prepare_event_data(self, md5_with_pii: MD5WithPII) -> dict: # Match the custom fields with the PII data log("debug", "Sending request to OpenAI for field mapping") response = self.openai_client.chat.completions.create( - model="gpt-4.1-mini", + model="gpt-5-mini", messages=[ { "role": "system", @@ -292,11 +292,7 @@ def _prepare_event_data(self, md5_with_pii: MD5WithPII) -> dict: ) } ], - max_tokens=4095, - temperature=0.7, top_p=1, - frequency_penalty=0, - presence_penalty=0, response_format={"type": "json_object"} ) diff --git a/requirements.txt b/requirements.txt index 1be4317..4128ec0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ pandas requests logfire>=3.16.2 -openai==1.97.0 +openai==2.14.0 reportlab>=4.4.2 python-dotenv