-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[Core] Improve config_list_from_json #1026
Conversation
The `env_or_file` variabe can point to an environment variable of file path.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1026 +/- ##
==========================================
+ Coverage 30.74% 40.54% +9.80%
==========================================
Files 30 30
Lines 4033 4037 +4
Branches 913 964 +51
==========================================
+ Hits 1240 1637 +397
+ Misses 2714 2289 -425
- Partials 79 111 +32
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 is helpful. It also addresses the issue with VScode's Jupyter notebook environment persisting old environment variables.
Updating this example notebook too? https://github.com/microsoft/autogen/blob/main/notebook/oai_openai_utils.ipynb
* add 1m milestone blogpost * format issues * update subsection title * acknowledgement * Update website/blog/2023-05-07-1M-milestone/index.mdx Co-authored-by: Chi Wang <[email protected]> * Update website/blog/2023-05-07-1M-milestone/index.mdx Co-authored-by: Chi Wang <[email protected]> * update blogpost * collaborators * wording * Azure Data to Azure Synapse * name * Azure Synapse Analytics * tasks and search space * Update website/blog/2023-05-07-1M-milestone/index.mdx Co-authored-by: Chi Wang <[email protected]> --------- Co-authored-by: Chi Wang <[email protected]> Co-authored-by: Li Jiang <[email protected]>
* Improve config_list_from_json The `env_or_file` variabe can point to an environment variable of file path. * Update autogen/oai/openai_utils.py Co-authored-by: Chi Wang <[email protected]> * Use "with" to open config file * Remove unused. * Remove accidental added file --------- Co-authored-by: Eric Zhu <[email protected]> Co-authored-by: Chi Wang <[email protected]>
UPDATE
The
env_or_file
variabe can point to an environment variable of file path now.In this new update, we check if the variable is a file or a json string. If it is a file, then it will load from the file.
Why are these changes needed?
It is a little bit confusing to the previous
config_list_from_json
function, where the environment variable would store a JSON string. It is usually more intuitive such that an environment variable points to a file location.Related issue number
Checks