GPT example should not need OPENAI_API_KEY at export time.
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 65/100
Research direction
Start with gpt/gpt/gpt.py at the client instantiation referenced in the issue. Reproduce the export without OPENAI_API_KEY, then defer client creation as described and verify that exporting the example no longer requires the environment variable.
Written by the indexing model from the issue text.
Description
openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
Solution is probably just to defer client instantiation by one function call. https://github.com/reflex-dev/reflex-examples/blob/cb3e32c1974e5a533c8507e1820bb643fdde53d0/gpt/gpt/gpt.py#L11 to become
def get_client():
return OpenAI()
- Dominant language
- Python
- Stars
- 576
- Forks
- 362
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from reflex-dev/reflex-examples
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
reflex-dev/reflex-examples#296 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
reflex-dev/reflex-examples#247 ·
-
counter example: why response is slow, when click really fast, the counter takes seconds to catch up Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
reflex-dev/reflex-examples#181 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
reflex-dev/reflex-examples#162 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
reflex-dev/reflex-examples#140 ·
All issues in reflex-dev/reflex-examples
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100