Skip to content

Conversation

@user-tony
Copy link

image

This is a problem caused by the update of Anthropic API. In the new version of Anthropic API, the way messages are sent has changed and the messages property is no longer used. Let me modify the code to solve this problem.

The main changes are as follows:

Simplified the message format and removed unnecessary nested content structures
Directly use strings as message content instead of using dictionary structures

],
}
]
new_msg_history = msg_history + [{"role": "user", "content": msg}, {"role": "assistant", "content": content}]
Copy link
Contributor

@conglu1997 conglu1997 Mar 23, 2025

Choose a reason for hiding this comment

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

I think the user content is duplicated here?

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