Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow use of OPENAI_API_KEY env var #707

Merged
merged 7 commits into from
Jan 1, 2024
Merged

Conversation

zzstoatzz
Copy link
Collaborator

@zzstoatzz zzstoatzz commented Dec 31, 2023

AttributeError: 'NoneType' object has no attribute 'get_secret_value'

we fail if the api key:

  • is not explicitly passed into a new client instance
  • is not set as MARVIN_OPENAI_API_KEY in ~/.marvin/.env

most users will likely just have OPENAI_API_KEY set somewhere on their machine, so we should use that for marvin.settings.openai.api_key if they haven't done one of the above

this PR also updates the quickstart to recommend setting the env var instead of passing the client around everywhere

@zzstoatzz zzstoatzz marked this pull request as ready for review December 31, 2023 19:53
@zzstoatzz zzstoatzz mentioned this pull request Dec 31, 2023
3 tasks
@zzstoatzz zzstoatzz requested a review from jlowin December 31, 2023 20:18
@aaazzam aaazzam self-requested a review December 31, 2023 22:50
@zzstoatzz zzstoatzz merged commit 905e710 into main Jan 1, 2024
12 checks passed
@zzstoatzz zzstoatzz deleted the better-api-key-discovery branch January 1, 2024 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants