You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In mem0/llms/aws_bedrock.py, _parse_response() previously evaluated response_json.get("completion", "") for legacy Amazon models (such as Amazon Titan text models). However, AWS Titan InvokeModel responses return text under results[0].outputText with no top-level completion field, causing generate_response() to always return "" and silently failing memory storage in Memory.add().
Changes Made:
Updated AWSBedrockLLM._parse_response() for the legacy amazon provider to inspect results[0].outputText first while preserving response_json.get("completion", "") as a fallback.
Added comprehensive unit test coverage in tests/llms/test_aws_bedrock.py verifying standard Titan responses, empty results fallback, and missing field handling.
Verification:
Ran pytest tests/llms/test_aws_bedrock.py — all 55 unit tests passed (100% pass rate).
We only review pull requests that fix an issue we have already agreed to take on, so this one is closed for now. Closed does not mean rejected. It means it is not in the queue yet, and reopening takes about a minute.
To get it reviewed:
Make sure an issue describes the problem, with the version you are on, a runnable reproduction, and the real output or traceback you saw.
Link it from this pull request description with Closes #<number>.
Ask a maintainer to label that issue accepted. This pull request reopens by itself when they do.
Issue already labeled accepted? Just add Closes #<number> to the description. That reopens this too.
Documentation-only changes skip this gate entirely.
Hi @Ritiky23, thanks for opening this pull request.
This is just a soft check: you are not yet in this repo's vouched contributor list (.github/VOUCHED.td). Nothing is blocked and there is nothing you need to do.
A maintainer can vouch for you by commenting !vouch @Ritiky23 on any issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Closes #7336
In
mem0/llms/aws_bedrock.py,_parse_response()previously evaluatedresponse_json.get("completion", "")for legacy Amazon models (such as Amazon Titan text models). However, AWS Titan InvokeModel responses return text underresults[0].outputTextwith no top-levelcompletionfield, causinggenerate_response()to always return""and silently failing memory storage inMemory.add().Changes Made:
AWSBedrockLLM._parse_response()for the legacyamazonprovider to inspectresults[0].outputTextfirst while preservingresponse_json.get("completion", "")as a fallback.tests/llms/test_aws_bedrock.pyverifying standard Titan responses, empty results fallback, and missing field handling.Verification:
Ran
pytest tests/llms/test_aws_bedrock.py— all 55 unit tests passed (100% pass rate).