Skip to content
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: Conversion of Anthropic Extension to M.E.AI interface [WIP] #4463

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lokitoth
Copy link
Member

@lokitoth lokitoth commented Dec 2, 2024

Why are these changes needed?

Enables use of multiple backends (as in 0.2) with 0.4 using the Microsoft.Extensions.AI interfaces.

Related issue number

Progress for #3919

Remaining to be done

  • AutoGen.Anthropic
  • AutoGen.Gemini
  • AutoGen.Mistral
  • AutoGen.WebAPI
  • AutoGen.DotnetInteractive (depends on AgentChat PR, coming soon)

Unclear if still needed with the M.E.AI.AIFunction

  • AutoGen.SourceGenerator?

These got done via MEAI hosting in Microsoft.AutoGen.Extensions.MEAI

  • AutoGen.Ollama
  • AutoGen.OpenAI
  • AutoGen.AzureAIInference

Checks

@LittleLittleCloud
Copy link
Collaborator

LittleLittleCloud commented Dec 2, 2024

I feel like this PR can benefit much more .NET developers if moving to M.E.AI library, what you think

@@ -0,0 +1,93 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
Copy link
Collaborator

@LittleLittleCloud LittleLittleCloud Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion that there's a library called AutoSDK which allows you to generate the client library from openapi.yaml. That might worth a try if you don't want to manually port the DTO classes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I just moved them over the AutoGen.Anthropic project so we can reuse the same code. Happy to rebuild the inner client on top of AutoSDK, if you think it is worth it?

Copy link
Collaborator

@LittleLittleCloud LittleLittleCloud Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think we can look into that option (or any options that enables generating OpenAPI client from schema, looks like there are quite a few of them Wondering how many of these options support polymorphism) after this PR. It's really attractive to me to not necessarily writing contract/DTO code by hand)

…hropic

* Keep public types in same namespaces for now
* Forward types to enable drop-in replacement
@lokitoth
Copy link
Member Author

lokitoth commented Dec 2, 2024

I feel like this PR can benefit much more .NET developers if moving to M.E.AI library, what you think

Agreed; the point of Microsoft.Autogen.Extensions.Anthropic is to provide an IChatClient implementation of the Anthropic APIs until there is an official variant. The only reason we keep the old infrastructure is that I did not want to rebuild everything by hand and have two copies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants