Update resume_yaml_generator.py

Updated resume_yaml_generator.py with the correct api key name present in the secrets.yaml file
This commit is contained in:
Shivam Sareen 2024-09-06 14:00:42 -07:00 committed by GitHub
parent f118bb6bf3
commit b45f3af360
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}") raise FileNotFoundError(f"Secrets file not found at {secrets_path}")
secrets = load_yaml(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: 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 return api_key
@ -153,4 +157,4 @@ def main():
print(f"An error occurred: {e}") print(f"An error occurred: {e}")
if __name__ == "__main__": if __name__ == "__main__":
main() main()