instructor
instructor copied to clipboard
feat: add watsonx support
https://github.com/jxnl/instructor/issues/619
:rocket: This description was created by Ellipsis for commit 52131d0f3628e6050c93c9ca749f783dcf344177 |
---|
Summary:
This PR adds support for IBM Watson AI in the instructor library, including a new example, updates to the instructor package and utils, and a new optional dependency in pyproject.toml
.
Key points:
- Added a new example file
watsonx.py
in theexamples/watsonx
directory. - Updated
instructor
package to include Watson AI support ifibm_watsonx_ai
is installed. - Added a new file
client_watsonx.py
in theinstructor
package, which contains the functionfrom_watsonx
. - Updated the
Provider
enum inutils.py
to includeWATSONX
. - Updated
pyproject.toml
to includeibm-watsonx-ai
as an optional dependency.
Generated with :heart: by ellipsis.dev
Yeah I think the easiest approach for this is to add LiteLLM support.
Would be keen on the LiteLLM support. Then people who use Amazon Bedrock can get involved.
LiteLLM support has been added, so I updated the docs to show how to use watsonx with via LiteLLM, so no new code changes.
Should I create a from_watsonx
still and wrap that functionality for ease of use, or would that be redundant? If not, its ready for review!
It sounds like you have made updates to the documentation to include information on how to use WatsonX with LiteLLM. Since there are no new code changes, we can focus on reviewing the existing code and documentation.
I can assist with various types of reviews on this pull request, such as:
- Readability
- Content
- SEO
- Vale
If you would like, I can review specific files or sections based on your preference. Just let me know which type of review you would like to prioritize or if you have any specific files in mind for review.
Regarding the decision to create a from_watsonx
function for ease of use, I recommend considering the necessity and potential benefits it would bring to the users. If you believe it would enhance the usability and clarity of the code, it might be worth implementing. However, if it would be redundant or unnecessary, it could be omitted.
Please let me know your preferences for the review or if you have any specific files you would like me to focus on.
Was waiting to test since my watsonx API key is on my work computer, but just tried it. I just updated LiteLLM to latest but it is still not out but it is on the docs. Likely will go out today so will bump the version when that happens
Understood! It's great that you were able to test the WatsonX API key and that you have updated LiteLLM to the latest version. Since LiteLLM is not yet released but the documentation reflects the upcoming changes, it's a good idea to bump the version once LiteLLM is officially out.
If you need any assistance with updating the version or any other related tasks once LiteLLM is released, feel free to let me know. Additionally, if you would like to proceed with a review of the pull request before the version bump, just give me the go-ahead, and I can start the review process.
Feel free to reach out if you have any further questions or need assistance with anything else!
Updated LiteLLM - examples tested and working
Review of the Content in docs/examples/watsonx.md
Overall Feedback:
We classified the document as a tutorial and rated the content quality as 6/10. To enhance the quality to 8 or better, focus on improving clarity, conciseness, and the use of active voice. Ensure technical terms are clearly defined and provide a smoother transition between sections for better coherence.
Specific Feedback:
-
Structured Outputs with IBM watsonx.ai:
- Consider making the title more descriptive and engaging, such as
Implementing Structured Outputs with IBM Watsonx.ai
.
- Consider making the title more descriptive and engaging, such as
-
watsonx.ai:
- The heading could be more specific, like
Setting Up Your Watsonx.ai Credentials
.
- The heading could be more specific, like
-
Example:
- The heading could be more specific to reflect the content of the code example, like
Python Example: Using Watsonx.ai for Model Inference
.
- The heading could be more specific to reflect the content of the code example, like
Content Issues:
-
watsonx.ai Section:
- Clarify the sentence structure to specify obtaining API key and project ID.
- Provide context or a brief description for the link to IBM product page.
-
Example Section:
- Explain the necessity of the code setting in the context of the example.
- Correct a grammatical error in the code comment.
Based on the content review of docs/examples/watsonx.md
, there are some areas that can be improved for better clarity and coherence. Consider addressing the highlighted issues to enhance the overall quality of the document.
If you would like further assistance with revising the content or have any specific areas you would like to focus on, feel free to let me know. Once the necessary adjustments are made, the document will be in better shape for users.
Let me know how you would like to proceed or if you need any additional support!
Made those fixes
Great job on making those fixes! It's important to ensure that the content is clear and accurate for users.
Since you have addressed the highlighted issues in the docs/examples/watsonx.md
file, the document should now provide a better experience for readers.
If you would like, I can perform another content review to verify the changes and ensure that everything is in order. Just let me know if you would like to proceed with another review or if there are any specific areas you would like me to focus on.
Feel free to provide further instructions or requests for assistance!