autogen icon indicating copy to clipboard operation
autogen copied to clipboard

feat: watsonx support

Open tsinggggg opened this issue 1 year ago • 5 comments

Why are these changes needed?

To enhance the support of non-OpenAI models with AutoGen, adding watsonx.ai into the mix to support both IBM granite series of models and others non-IBM models hosted in watsonx.ai

Related issue number

Checks

  • [x] I've included any doc changes needed for https://microsoft.github.io/autogen/. See https://microsoft.github.io/autogen/docs/Contribute#documentation to build and test documentation locally.
  • [x] I've added tests (if relevant) corresponding to the changes introduced in this PR.
  • [x] I've made sure all auto checks have passed.

tsinggggg avatar Nov 08 '24 06:11 tsinggggg

@microsoft-github-policy-service agree

tsinggggg avatar Nov 08 '24 06:11 tsinggggg

Hi @Hk669 , would you please review this PR? I saw you review the latest addition of non-oai client bedrock. I am happy to follow up with a PR towards the main branch later as well. Thank you!

tsinggggg avatar Nov 08 '24 06:11 tsinggggg

@tsinggggg thank you for your contribution!

Given we are close to release of v0.4 version. Would you like to create a community package for Wasonx client following the v0.4 ChatCompletionClient protocol? You can find existing implementations here: https://github.com/microsoft/autogen/tree/main/python/packages/autogen-ext/src/autogen_ext/models.

For guidance on how to create a community package: https://microsoft.github.io/autogen/dev/user-guide/extensions-user-guide/index.html

Once you create one you can submit a PR to our documentation so we can index it.

The reason we ask for community package is because it is not feasible for us to maintain clients to APIs that we don't have access to.

ekzhu avatar Nov 10 '24 04:11 ekzhu

Hi @ekzhu , thanks a lot for the suggestions!

I created an extension for using watsonx with autogen 0.4. I released it to pypi here https://pypi.org/project/autogen-watsonx-client/

This is the PR https://github.com/microsoft/autogen/pull/4130 for the doc update in the main branch if you would review. Thank you!

tsinggggg avatar Nov 11 '24 06:11 tsinggggg

Codecov Report

Attention: Patch coverage is 8.60927% with 138 lines in your changes missing coverage. Please review.

Project coverage is 29.05%. Comparing base (8a8fcd8) to head (a966cae). Report is 3 commits behind head on 0.2.

Files with missing lines Patch % Lines
autogen/oai/watsonx.py 6.42% 131 Missing :warning:
autogen/oai/client.py 40.00% 5 Missing and 1 partial :warning:
autogen/runtime_logging.py 0.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##              0.2    #4094      +/-   ##
==========================================
- Coverage   29.30%   29.05%   -0.25%     
==========================================
  Files         117      118       +1     
  Lines       13013    13168     +155     
  Branches     2469     2496      +27     
==========================================
+ Hits         3813     3826      +13     
- Misses       8854     8995     +141     
- Partials      346      347       +1     
Flag Coverage Δ
unittests 29.05% <8.60%> (-0.25%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Nov 26 '24 02:11 codecov-commenter

@tsinggggg seems CI is failing, marking this as awaiting-op-response.

MohMaz avatar Nov 27 '24 01:11 MohMaz

closing as https://github.com/microsoft/autogen/pull/4130 has been merged to 0.4 version

tsinggggg avatar Nov 27 '24 02:11 tsinggggg