Merge pull request #304 from shivamkrsarin1996/patch-2
Update resume_yaml_generator.py
This commit is contained in:
commit
77f5b5ab9e
1 changed files with 7 additions and 3 deletions
|
|
@ -21,9 +21,13 @@ def get_api_key() -> str:
|
|||
raise FileNotFoundError(f"Secrets file not found at {secrets_path}")
|
||||
|
||||
secrets = load_yaml(secrets_path)
|
||||
api_key = secrets.get('openai_api_key')
|
||||
|
||||
if not 'llm_api_key' in secrets:
|
||||
raise KeyError("No key as llm_api_key in the secret.yaml")
|
||||
|
||||
api_key = secrets.get('llm_api_key')
|
||||
if not api_key:
|
||||
raise ValueError("OpenAI API key not found in secrets.yaml")
|
||||
raise ValueError("LLM API key not found in secrets.yaml")
|
||||
|
||||
return api_key
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue