codeacme17 / examor

For students, scholars, interviewees and lifelong learners. Let LLMs assist you in learning 🎓
GNU Affero General Public License v3.0
1.07k stars 71 forks source link

[FEAT]: Supporting openai base change or supporting python dotenv as server loading #11

Closed redreamality closed 1 year ago

redreamality commented 1 year ago

Description

.env file

OPENAI_API_KEY=xxx OPENAI_API_TYPE=open_ai OPENAI_API_BASE="xxxx"

python file

from dotenv import load_dotenv load_dotenv(".env")

codeacme17 commented 1 year ago

OPENAI_API_BASE is for Azure right? I don't know whether openai also needs to set this parameter.. The environment variables here are all configured by the user through the client, and then I will store them in the corresponding database, and finally store them in the python environment variables

redreamality commented 1 year ago

you can set it either for openai.
This is an approach to supporting calling openai API behind an enterprise gateway.

codeacme17 commented 1 year ago

OK, i will test, thx for your enhancement.

codeacme17 commented 1 year ago

@redreamality Thanks for the suggestion, I added the openai_api_base config option