-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(db): refactor db to support redis #783
Conversation
Hi @lwaekfjlk , Please review this PR once and let me know your thoughts on this. |
thanks, I will check later today |
Hi @lwaekfjlk , |
@shreypandey wow, your PR is amazing! Let's work together on more things! |
I just leave some little comments, generally looks amazingly good to me. |
.env.template
Outdated
@@ -0,0 +1,5 @@ | |||
# openai keys | |||
OPENAI_API_KEY= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think is the advantage for using env compared with using export ENV_NAME.
For env, maybe add something like OPENAI_API_KEY="xxx"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think is the advantage for using env compared with using export ENV_NAME.
Hey @lwaekfjlk ,
When we integrate redis(or some other vectorDB), they generally have their set of ENV variables we need to provide.
This is similar to the scenario when we want to use any other llm provider(such as azure etc) apart from default openai in litellm.
So, to accommodate the increasing number of env variables, it'll be easier to set the env variables by sourcing the env file rather than individually setting each variable. In shell, the command to source the env file looks something like this:
$ set -a
$ source .env
$ set +a
Let me know your thoughts on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For env, maybe add something like OPENAI_API_KEY="xxx"?
The idea behind this is, that .env.template
file is a placeholder file which specify all the env variable names the project is using. Users will create a .env
file based on this template(they can just copy the entire template file).
Putting empty value denotes that the variable wasn't set by the user and can be handled appropriately in python code. Something like
api_key = os.getenv("OPENAI_API_KEY") # given empty string if variable is not set
asset api_key # Assertion error if API_KEY is not set, similar to not setting the value
Let me know your thoughts.
Sure @lwaekfjlk ! Would love to work on more things! |
@shreypandey thanks for your efforts, I merged #785 |
Hi @lwaekfjlk, I have tested the code by running the test cases, examples and demo. |
sure. This is a big PR so I need to take some time and confirm on my side everything in bench works as well. |
Sure @lwaekfjlk! Let me know your feedback and incase of any issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR basically add an abstract layer to link to multiple types of basic support of DB (local / redis). The concrete Redis support needs to be implemented later.
Closes #782
π Description
β Checks
type/descript
(e.g.feature/add-llm-agents
)βΉ Additional Information