forked from Archives/langchain
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 |
||
---|---|---|
.. | ||
agents | ||
callbacks | ||
chains | ||
indexes | ||
memory | ||
models | ||
prompts | ||
utils/examples | ||
agents.rst | ||
chains.rst | ||
indexes.rst | ||
memory.rst | ||
models.rst | ||
paul_graham_essay.txt | ||
prompts.rst | ||
state_of_the_union.txt |