File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33from typing import List , Dict
44import json
55
6- client = OpenAI (api_key = os .getenv ("OPENAI_API_KEY" ))
6+ # Initialize OpenAI client only if API key is available
7+ client = None
8+ if os .getenv ("OPENAI_API_KEY" ):
9+ client = OpenAI (api_key = os .getenv ("OPENAI_API_KEY" ))
710
811def find_matching_jobs (coaching_summary : Dict , num_jobs : int = 5 ) -> List [Dict ]:
912 """
1013 Use OpenAI to find matching jobs based on the career coaching summary.
1114 Returns a list of job matches with titles, descriptions, and match reasons.
1215 """
16+ if not client :
17+ print ("OpenAI client not initialized - API key not found" )
18+ return []
19+
1320 system_prompt = """You are a job matching expert. Your task is to find relevant job opportunities
1421 based on the candidate's career coaching summary. For each job, provide:
1522 1. A realistic job title
You can’t perform that action at this time.
0 commit comments