-
Couldn't load subscription status.
- Fork 485
added logic to extract text from ThinkingBlock #2139
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
base: main
Are you sure you want to change the base?
added logic to extract text from ThinkingBlock #2139
Conversation
|
@ManuelPeixotoCegid Could you add a test to cover this part? |
|
@ManuelPeixotoCegid Could you share your contacts (discord or email) that I could follow up on this? And could you sign the Contributor License Agreement? |
|
@randombet reachout to me at mapeixoto@cegid.com and I have just signed it :) |
|
@ManuelPeixotoCegid Could you address the comments and add the test? |
Codecov Report❌ Patch coverage is
... and 20 files with indirect coverage changes 🚀 New features to boost your workflow:
|
This pull request updates the handling of Anthropic message responses by supporting the new
ThinkingBlocktype introduced in Anthropic version 0.23.1 and improving the extraction logic for JSON responses. The changes ensure that the code can correctly parse bothTextBlockandThinkingBlockcontent types.Support for new Anthropic content types:
ThinkingBlocktype fromanthropic.typesto enable handling of messages that use this new block type.Improved response extraction logic:
_extract_json_responsemethod inautogen/oai/anthropic.pyto check the type of the first item in theresponse.contentlist, extracting text fromTextBlockor thinking fromThinkingBlockas appropriate.