Conversation
… inventory This commit updates the `object_to_text` function in `utils.py` to handle special cases for "position" and "inventory" keys. The position now formats room and coordinates more clearly, while the inventory displays individual items with "has" statements. Additionally, the `match.py` file removes redundant threshold adjustments for the LTM tier. Test cases in `test_load_from_json.py` and `test_embedding_utils.py` are updated to reflect changes in sample files and improve validation checks. The schema tests are also adjusted to focus on relevant samples.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the formatting of the object_to_text function by providing special handling for "position" and "inventory" keys and cleans up redundant code in match.py. It also updates several tests to reflect these changes and align agent identifiers across the test suite.
- Enhanced object formatting for position and inventory in utils.py.
- Removed redundant threshold adjustments for the LTM tier in match.py.
- Updated tests and agent IDs in test_load_from_json.py, test_schema.py, and test_match_strategy.py.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| validation/search/attribute/attribute_test_suite.py | Updated expected memory IDs with in-line comments for clarity. |
| tests/test_schema.py | Removed outdated sample references; tests now focus on attribute validation. |
| tests/test_load_from_json.py | Removed simple agent tests and updated agent IDs to reflect new sample usage. |
| tests/search/test_match_strategy.py | Updated lambda signatures for memory store retrieval to include agent_id for clarity. |
| tests/embeddings/test_embedding_utils.py | Updated assertions to check for individual "has" statements and coordinate formatting. |
| memory/search/strategies/match.py | Removed redundant LTM threshold adjustment. |
| memory/embeddings/utils.py | Refactored object_to_text to provide enhanced and clearer formatting. |
Comments suppressed due to low confidence (2)
tests/test_load_from_json.py:147
- [nitpick] The change from 'demo_agent' to 'test-agent-attribute-search' appears intentional; please verify that all test assertions and their associated memory samples are updated consistently across the test suite.
valid_data = load_and_validate(str(ATTRIBUTE_VALIDATION_SAMPLE))
tests/search/test_match_strategy.py:53
- [nitpick] Ensure that the updated lambda signatures (with agent_id and memory_id) are fully consistent with how the get() methods are invoked elsewhere in the codebase to avoid parameter misalignment.
self.mock_stm_store.get.side_effect = lambda agent_id, memory_id: {
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This Pull Request refactors the
object_to_textfunction withinutils.pyto enhance the readability and formatting of "position" and "inventory" keys. By making these changes, we aim to improve the clarity of text outputs, aiding in better user understanding and interaction.Changes
object_to_textFunction:match.py:test_load_from_json.pyandtest_embedding_utils.pytest cases to align with the new formatting changes. This includes modifications to sample files and validation check improvements.Testing
Impact
By refining these functions, we enhance the utility and functionality of the system, providing clearer information to users and developers.
This PR description was enhanced by AI to improve clarity.