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

fix AnthropicClient to make it work with ConversableAgent #2807

Closed
wants to merge 1 commit into from

Conversation

teilomillet
Copy link

Why are these changes needed?

The create in AnthropicClient wasn't conform the Anthropic API.

Related issue number

Checks

@teilomillet
Copy link
Author

@microsoft-github-policy-service agree

@levscaut
Copy link
Collaborator

Thanks for the contribution! I think you may need to control the scope of modified files. Multiple files irrelevant to this PR are modified. I think maybe only the notebook itself should be modified. You can follow the contribution guidelines here: https://microsoft.github.io/autogen/docs/contributor-guide/contributing/

@marklysze
Copy link
Collaborator

Hi @teilomillet, thanks for creating this.

I've tried to run it with the current Anthropic library, v0.28.0 and I can't run the second cell:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[5], [line 16](vscode-notebook-cell:?execution_count=5&line=16)
     [14] TOOL_ENABLED = anthropic_version >= "0.23.1"
     [15] if TOOL_ENABLED:
---> [16]     from anthropic.types.beta.tools import ToolsBetaMessage
     [17] else:
     [18]     ToolsBetaMessage = object

ModuleNotFoundError: No module named 'anthropic.types.beta'

Just checking if it's working for you?

@JustLolo
Copy link

JustLolo commented Jun 7, 2024

Hi @teilomillet, thanks for creating this.

I've tried to run it with the current Anthropic library, v0.28.0 and I can't run the second cell:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[5], [line 16](vscode-notebook-cell:?execution_count=5&line=16)
     [14] TOOL_ENABLED = anthropic_version >= "0.23.1"
     [15] if TOOL_ENABLED:
---> [16]     from anthropic.types.beta.tools import ToolsBetaMessage
     [17] else:
     [18]     ToolsBetaMessage = object

ModuleNotFoundError: No module named 'anthropic.types.beta'

Just checking if it's working for you?

I am trying to make this work, and no, it's not working for me, same error I guess

ModuleNotFoundError Traceback (most recent call last)
in <cell line: 15>()
14 TOOL_ENABLED = anthropic_version >= "0.23.1"
15 if TOOL_ENABLED:
---> 16 from anthropic.types.beta.tools import ToolsBetaMessage
17 else:
18 ToolsBetaMessage = object

ModuleNotFoundError: No module named 'anthropic.types.beta'

@brycecf
Copy link

brycecf commented Jun 13, 2024

It is an improvement but it doesn't seem to fully resolve issues, which I believe are associated with Autogen's underlying reliance on the OpenAI format.

For example, if I run the two-agent example here, I get the following error:

BadRequestError: Error code: 400 - {'message': 'messages: roles must alternate between "user" and "assistant", but found multiple "user" roles in a row'}

@microsoft microsoft deleted a comment Jun 14, 2024
@Hk669
Copy link
Collaborator

Hk669 commented Jun 21, 2024

@teilomillet thanks for the PR , we enhanced the support of AutoGen with Anthropic Client #2946. changes made in this PR are no longer necessary. any issues faced, please reach out to us on discord.

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.

6 participants