-
Notifications
You must be signed in to change notification settings - Fork 48
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: Support calling the OpenAI API directly #85
Conversation
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.
Summary by GPT-4
In this commit, the README.md file has been updated to provide clearer instructions on how to install and set up the CLI tool. The _llama_index.py
file has been updated to support both Azure OpenAI and OpenAI API types. The _openai.py
file has been updated to use the term "model" instead of "engine" for consistency. The context.py
file has been updated to load context from environment variables or context files, with precedence given to config files if available. The test files have also been updated accordingly.
Overall, these changes improve the clarity of instructions and provide better support for different API types.
Suggestions
Here are some suggestions for improving the changes in this PR:
-
In the
README.md
file, change the title "How to install CLI" to "How to Install CLI" for consistency in capitalization. -
In the
_llama_index.py
file, add a comment explaining the difference between using Azure OpenAI API and OpenAI API directly in the_load_service_context()
function. -
In the
context.py
file, update the docstring of_load_azure_openai_context()
function to mention that it also checks forOPENAI_API_KEY
environment variable if Azure OpenAI API is not available. -
In the
test_gpt_cli.py
file, update the import statement to follow PEP8 guidelines:from gpt_review._gpt_cli import cli import gpt_review.constants as C
-
In the
test_openai.py
file, update function names and test names to reflect changes from "engine" to "model":- Rename
get_engine_test()
toget_model_test()
- Rename
test_get_engine()
totest_get_model()
- Rename
test_int_get_engine()
totest_int_get_model()
- Rename
-
Update comments and docstrings throughout the codebase where "engine" is mentioned but should now be "model".
@microsoft-github-policy-service agree |
Codecov Report
@@ Coverage Diff @@
## main #85 +/- ##
===========================================
- Coverage 100.00% 93.48% -6.52%
===========================================
Files 13 13
Lines 462 476 +14
Branches 67 74 +7
===========================================
- Hits 462 445 -17
- Misses 0 22 +22
- Partials 0 9 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
|
4611742
to
b63415e
Compare
@msnidal , looks great! Will get this sorted out and merged in. |
I realize now my isort has not been working. I am going to create a new PR that just takes care of all the import fixes. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
i was expecting the tests to run using my repos creds.... so that the tests would run properly. |
Description
Support for going through the OpenAI API directly in addition to the existing Azure support (API and secrets). Also moves to the
model
notation as theengine
param is deprecated and failed when hitting the OpenAI API directly.Updates the README with more clarity on the order of operations
Testing
TODO
Additional context
I dont work at microsoft nor have an Azure account so I'm not sure how the engine vs. model distinction works on a custom Azure OpenAI endpoint 🤔