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

New Feature: Anthropic Function Calling #8893

Open
andrewldesousa opened this issue Sep 18, 2024 · 4 comments
Open

New Feature: Anthropic Function Calling #8893

andrewldesousa opened this issue Sep 18, 2024 · 4 comments
Assignees
Labels
ai connector Anything related to AI connectors

Comments

@andrewldesousa
Copy link
Contributor

Extend Anthropic connector to support function calling

@andrewldesousa
Copy link
Contributor Author

working on this now, will try to open PR this week!

@markwallace-microsoft
Copy link
Member

@andrewldesousa We have new function calling abstractions and a reusable implementation. I've asked @SergeyMenshykh to respond here with details of how to use this. We want to consolidate all of our function calling implementations and these abstractions will make the job of adding this functionality much easier.

@SergeyMenshykh
Copy link
Member

SergeyMenshykh commented Sep 19, 2024

Hi @andrewldesousa, thanks for your contribution to make SK better.

As @markwallace-microsoft said, we have the new function calling abstraction that we released this week - https://devblogs.microsoft.com/semantic-kernel/new-function-calling-model-available-in-net-for-semantic-kernel/ and that we plan to develop and use in all SK connectors from now on.

The function call handling and function invocation functionality are encapsulated in the new FunctionCallsProcessor class. Connectors should use this class to obtain function calling configuration and process function calls and invoke funcitons.

After obtaining SK function calling configuration, connectors should map it to AI model specific API configuration model classes as it's done for {Azure}OpenAI connectors - mapping of SK model to OpenAI one.

Additionally, connectors should map AI model-specific API function call model classes to the SK ones and add them to the chat message content Items collection as is done here - map tool calls to function call contents. Similarly, map SK function result contents to AI model-specific API function result model classes as is done here - map function result content to tool chat message.

Please disregard all the code that uses the current function calling model represented by the ToolCallBehavior class when you encounter it in a few other SK connectors. It's there for backward compatibility and should not be migrated to the new SK connectors. Feel free to contact us if you have questions.

@andrewldesousa
Copy link
Contributor Author

@SergeyMenshykh thanks. this design is followed by both python and c sharp?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai connector Anything related to AI connectors
Projects
Status: Community PRs
Development

No branches or pull requests

4 participants