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:
parent
f118bb6bf3
commit
b45f3af360
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}")
|
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()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue