-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
Update getting_started.md #4482
Conversation
- Update: Quickstart Guide > Environment Setup - Reason: Recently, many applications have required each user's API key. But, "export OPENAI_API_KEY" or "os.environ" is for a project-wide setting. So I added another way the user could dynamically assign the API key.
When I first saw the LLMChain, I needed clarification about how to input multiple variables because there is no explanation for the "chain.run" function in detail. So, I added a simple example for multi variables. This is a short example but it will be helpful to one who wants to make various prompts.
@@ -40,6 +40,8 @@ | |||
"source": [ | |||
"from langchain.prompts import PromptTemplate\n", | |||
"from langchain.llms import OpenAI\n", | |||
"import os\n", | |||
"os.environ[\"OPENAI_API_KEY\"] = \"Your-API-KEY\"\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the API key is not set to a correctly value here, would you mind commenting this code out. It will make it easy for us to keep on re-running the notebook if we need to update it while also informing users that they can set the value dynamically (but first have to uncomment the code)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your advice. That's right. I agree with you.
So, I deleted two lines and committed again with the message: "Deleted key setting lines because how to set the OpenAI key has already been guided." I still need to familiarize myself with open-source contributions. So, if I still need to correct something, please let me know.
@bongsang Thank you for helping improve the documents! I have one comment about the notebook, let me know if you have any thoughts / objections. |
set the OpenAI key has already been guided.
Added another helpful way for developers who want to set OpenAI API Key dynamically
Previous methods like exporting environment variables are good for project-wide settings.
But many use cases need to assign API keys dynamically, recently.
Before submitting
Or,
Thank you.
Cheers,
Bongsang