Closed wrharper-AASP closed 1 year ago
did you try the terminal?
did you try the terminal?
I'm in windows so in the python script I put it after an os import as a workaround. The point is there is no direction on how to do this in the readme
The environment variables get read by the retrieval plugin to access your openai key, database credentials, etc. So you want to set those environment variables in whatever context that you're starting the retrieval plugin with, so the program can access those. On unix machines, you'd just copy those environment variables into your terminal one by one, then execute the command to start the program (poetry run dev
, or how ever you're starting it.) On windows, you can follow the instructions here: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/set_1 and like the instructions say, instead of using the export name=value
command you would use set name=value
That explained, I don't think a README for this program needs to contain detailed instructions for how to set environment variables in every conceivable OS, it would get crowded with minutia. You're expected to do a little research of your own. You could just ask chatGPT how to set environment variables in your chosen OS, or even write you a little script to automate the process so you don't need to type them in every time.
Actually, I did it in the code and it should work on every OS. like this for example: os.environ["DATASTORE"] = "chroma" It should be possible to put it in one a .py file and just fill out the info and it should work regardless since import os takes care of that.
This is also better because it still keeps the environment variables clean too.
This is also better because it still keeps the environment variables clean too.
A good idea for your own personal project, but you wouldn't want to commit your database password accidentally to GitHub, so to help people avoid shooting themselves in the foot, I like the "type these environment variables into the shell" and further automation is left to the reader.
that is handled too for me, but i see your point. it is authed in a secure way. no way for anyone to see it for me. os.environ['OPENAI_API_KEY'] = GetSecretKey(client)
Where?