Find answers from the community

Updated 3 months ago

quick question, how to specify the

quick question, how to specify the organization id on OpenAi llm?
tried using the following as env variables and through passing them to the init, didnt work:

  • organization
  • OPENAI_ORGANIZATION
OpenAI reference:
https://platform.openai.com/docs/api-reference/authentication
W
W
3 comments
Plain Text
import openai
openai.organization="org ID"

This should work
thanks for the reply, its more of the releam of llama:
Plain Text
from llama_index.core import Settings
from llama_index.llms.openai import OpenAI
Settings.llm = OpenAI()
You can still do this:
Plain Text
from llama_index.core import Settings
from llama_index.llms.openai import OpenAI
Settings.llm = OpenAI(organization="orgID",...)

# if not this then
from llama_index.core import Settings
from llama_index.llms.openai import OpenAI
import openai

openai.organization="org ID"
Settings.llm = OpenAI()
Add a reply
Sign up and join the conversation on Discord