mirror of
https://github.com/hwchase17/langchain
synced 2024-10-29 17:07:25 +00:00
613bf9b514
# 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. ```python from langchain.llms import OpenAI llm = OpenAI(openai_api_key="OPENAI_API_KEY") ``` ## Before submitting ```bash export OPENAI_API_KEY="..." ``` Or, ```python import os os.environ["OPENAI_API_KEY"] = "..." ``` <hr> Thank you. Cheers, Bongsang |
||
---|---|---|
.. | ||
examples | ||
generic | ||
index_examples | ||
getting_started.ipynb | ||
how_to_guides.rst |