File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -69,17 +69,22 @@ def fetch_daily_problem():
6969def generate_solution_with_ai (problem_info , api_key ):
7070 """
7171 Use OpenAI GPT-5-mini to generate a solution for the problem.
72-
72+
7373 Args:
7474 problem_info (dict): Problem details from LeetCode
7575 api_key (str): OpenAI API key
76-
76+
7777 Returns:
7878 str: Generated solution in markdown format
7979 """
8080 try :
81- client = OpenAI (api_key = api_key )
82-
81+ import httpx
82+
83+ # Create an httpx client that doesn't verify SSL certificates
84+ # This is needed when running behind a proxy with self-signed certificates
85+ http_client = httpx .Client (verify = False )
86+ client = OpenAI (api_key = api_key , http_client = http_client )
87+
8388 # Create a detailed prompt for the AI
8489 prompt = f"""You are solving a LeetCode problem. Generate a complete solution following this exact format:
8590
@@ -114,9 +119,9 @@ def generate_solution_with_ai(problem_info, api_key):
114119 {"role" : "system" , "content" : "You are an expert software engineer solving LeetCode problems. Provide clear explanations and efficient solutions." },
115120 {"role" : "user" , "content" : prompt }
116121 ],
117- max_completion_tokens = 2000
122+ max_completion_tokens = 8000
118123 )
119-
124+
120125 return response .choices [0 ].message .content
121126
122127 except Exception as e :
You can’t perform that action at this time.
0 commit comments