Merge pull request #304 from shivamkrsarin1996/patch-2

Update resume_yaml_generator.py
This commit is contained in:
Federico 2024-09-08 00:09:11 +02:00 committed by GitHub
commit 77f5b5ab9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
@ -153,4 +157,4 @@ def main():
print(f"An error occurred: {e}")
if __name__ == "__main__":
main()
main()