Skip to content

fix AnthropicClient to make it work with ConversableAgent#2807

Closed
teilomillet wants to merge 1 commit into
microsoft:mainfrom
teilomillet:main
Closed

fix AnthropicClient to make it work with ConversableAgent#2807
teilomillet wants to merge 1 commit into
microsoft:mainfrom
teilomillet:main

Conversation

@teilomillet
Copy link
Copy Markdown

Why are these changes needed?

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

Related issue number

Checks

@teilomillet
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@levscaut
Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown
Contributor

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