run-llama / llama_index

LlamaIndex is a data framework for your LLM applications

Home Page:https://docs.llamaindex.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Some notebooks set OPENAI_API_TOKEN instead of OPENAI_API_KEY

joelrorseth opened this issue · comments

Bug Description

Some notebooks in the docs set the OPENAI_API_TOKEN environment variable instead of the correct OPENAI_API_KEY variable. The latter is the correct environment variable llama_index looks for when calling OpenAI's API. The former is not correct, and users will encounter errors when the proper variable is not set.

Version

0.10.36

Steps to Reproduce

Follow the instructions in an affected notebook (e.g., https://docs.llamaindex.ai/en/stable/examples/multi_modal/openai_multi_modal/). In other words, use the following incorrect configuration before running any llama_index code that uses the OpenAI API:

import os

OPENAI_API_TOKEN = "sk-"  # Your OpenAI API token here
os.environ["OPENAI_API_TOKEN"] = OPENAI_API_TOKEN

Relevant Logs/Tracbacks

No response