microsoft / autogen

A programming framework for agentic AI 🤖
https://microsoft.github.io/autogen/
Creative Commons Attribution 4.0 International
34.85k stars 5.05k forks source link

feat: watsonx support #4094

Open tsinggggg opened 2 weeks ago

tsinggggg commented 2 weeks ago

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

tsinggggg commented 2 weeks ago

@microsoft-github-policy-service agree

tsinggggg commented 2 weeks ago

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!

ekzhu commented 2 weeks ago

@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.

tsinggggg commented 2 weeks ago

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!

codecov-commenter commented 16 hours ago

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 ```diff @@ 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](https://app.codecov.io/gh/microsoft/autogen/pull/4094/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/microsoft/autogen/pull/4094/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft) | `29.05% <8.60%> (-0.25%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft#carryforward-flags-in-the-pull-request-comment) to find out more.

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