Skip to content

API Reference parrot.tools.working_memory.tests.test_generic_entries

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.tools.working_memory.tests.test_generic_entries

View source

Tests for generic (non-DataFrame) entry support in WorkingMemoryToolkit.

Covers:

  • EntryType enum values
  • _detect_entry_type() auto-detection
  • GenericEntry.compact_summary() for each EntryType
  • WorkingMemoryCatalog.put_generic() / get / drop
  • WorkingMemoryToolkit.store_result(), get_result(), search_stored()
  • list_stored() with mixed DataFrame + generic entries
  • drop_stored() on generic entries
  • Backward compatibility: existing DataFrame tools unchanged

Alias CatalogEntry

Re-exported from parrot.tools.working_memory.internals.CatalogEntry.

Alias EntryType

Re-exported from parrot.tools.working_memory.EntryType.

Alias GenericEntry

Re-exported from parrot.tools.working_memory.GenericEntry.

Alias GetResultInput

Re-exported from parrot.tools.working_memory.models.GetResultInput.

Alias SearchStoredInput

Re-exported from parrot.tools.working_memory.models.SearchStoredInput.

Alias StoreResultInput

Re-exported from parrot.tools.working_memory.models.StoreResultInput.

Class TestBackwardCompat

Existing DataFrame tools must be unaffected by FEAT-074 changes.

Method TestBackwardCompat.test_store_dataframe

test_store_dataframe(census_df)

Parameter Type Default Description
census_df

Method TestBackwardCompat.test_get_stored_dataframe

test_get_stored_dataframe(census_df)

Parameter Type Default Description
census_df

Method TestBackwardCompat.test_drop_dataframe

test_drop_dataframe(census_df)

Parameter Type Default Description
census_df

Class TestCatalogGenericEntries

WorkingMemoryCatalog with generic entries.

Method TestCatalogGenericEntries.test_put_generic_auto_detect

test_put_generic_auto_detect()

Method TestCatalogGenericEntries.test_put_generic_explicit_type

test_put_generic_explicit_type()

Method TestCatalogGenericEntries.test_put_generic_with_metadata

test_put_generic_with_metadata()

Method TestCatalogGenericEntries.test_get_generic

test_get_generic()

Method TestCatalogGenericEntries.test_drop_generic

test_drop_generic()

Method TestCatalogGenericEntries.test_contains_generic

test_contains_generic()

Method TestCatalogGenericEntries.test_len_mixed

test_len_mixed()

Method TestCatalogGenericEntries.test_list_mixed_entries

test_list_mixed_entries()

Method TestCatalogGenericEntries.test_list_df_entry_has_entry_type

test_list_df_entry_has_entry_type()

Method TestCatalogGenericEntries.test_generic_replaces_dataframe

test_generic_replaces_dataframe()

Method TestCatalogGenericEntries.test_dataframe_replaces_generic

test_dataframe_replaces_generic()

Class TestDetectEntryType

Auto-detection heuristic for Python objects.

Method TestDetectEntryType.test_str_is_text

test_str_is_text()

Method TestDetectEntryType.test_bytes_is_binary

test_bytes_is_binary()

Method TestDetectEntryType.test_dict_is_json

test_dict_is_json()

Method TestDetectEntryType.test_list_is_json

test_list_is_json()

Method TestDetectEntryType.test_message_duck_type

test_message_duck_type()

Method TestDetectEntryType.test_dataframe

test_dataframe()

Method TestDetectEntryType.test_fallback_int

test_fallback_int()

Method TestDetectEntryType.test_fallback_none

test_fallback_none()

Class TestDropGeneric

drop_stored() works for GenericEntry.

Method TestDropGeneric.test_drop_generic_entry

test_drop_generic_entry()

Method TestDropGeneric.test_drop_nonexistent

test_drop_nonexistent()

Class TestEntryType

Verify the EntryType enum has all expected values.

Method TestEntryType.test_all_values

test_all_values()

Method TestEntryType.test_str_enum

test_str_enum()

Class TestGenericEntrySummary

Type-aware compact_summary for each EntryType.

Method TestGenericEntrySummary.test_text_summary

test_text_summary()

Method TestGenericEntrySummary.test_text_truncation

test_text_truncation()

Method TestGenericEntrySummary.test_json_dict_summary

test_json_dict_summary()

Method TestGenericEntrySummary.test_json_list_summary

test_json_list_summary()

Method TestGenericEntrySummary.test_message_summary

test_message_summary(sample_message)

Parameter Type Default Description
sample_message

Method TestGenericEntrySummary.test_binary_summary_no_content

test_binary_summary_no_content()

Method TestGenericEntrySummary.test_binary_human_readable_kb

test_binary_human_readable_kb()

Method TestGenericEntrySummary.test_object_summary

test_object_summary()

Method TestGenericEntrySummary.test_description_in_summary

test_description_in_summary()

Class TestGetResult

get_result() async tool method.

Method TestGetResult.test_get_text

test_get_text()

Method TestGetResult.test_get_include_raw

test_get_include_raw()

Method TestGetResult.test_get_truncated

test_get_truncated()

Method TestGetResult.test_get_missing_key_raises

test_get_missing_key_raises()

Method TestGetResult.test_get_dict_raw

test_get_dict_raw()

Class TestListMixed

list_stored() with both DataFrame and generic entries.

Method TestListMixed.test_list_all_types

test_list_all_types()

Method TestListMixed.test_list_includes_entry_type_for_df

test_list_includes_entry_type_for_df()

Class TestSearchStored

search_stored() async tool method.

Method TestSearchStored.test_search_by_description

test_search_by_description()

Method TestSearchStored.test_search_by_key

test_search_by_key()

Method TestSearchStored.test_search_case_insensitive

test_search_case_insensitive()

Method TestSearchStored.test_search_by_type_text

test_search_by_type_text()

Method TestSearchStored.test_search_by_type_dataframe

test_search_by_type_dataframe()

Method TestSearchStored.test_search_empty_query_all

test_search_empty_query_all()

Method TestSearchStored.test_search_no_match

test_search_no_match()

Class TestStoreResult

store_result() async tool method.

Method TestStoreResult.test_store_text

test_store_text()

Method TestStoreResult.test_store_dict

test_store_dict()

Method TestStoreResult.test_store_list

test_store_list()

Method TestStoreResult.test_store_bytes

test_store_bytes()

Method TestStoreResult.test_store_message

test_store_message(sample_message)

Parameter Type Default Description
sample_message

Method TestStoreResult.test_store_with_metadata

test_store_with_metadata()

Method TestStoreResult.test_store_explicit_type

test_store_explicit_type()

Method TestStoreResult.test_store_invalid_type_falls_back_to_auto

test_store_invalid_type_falls_back_to_auto()

Method TestStoreResult.test_data_field_in_tool_schema

Regression: the LLM-facing schema must advertise data as required.

Previously StoreResultInput omitted data, so the agent path stripped it during model_dump() and the bound method raised TypeError: store_result() missing 1 required positional argument: 'data'.

test_data_field_in_tool_schema()

Method TestStoreResult.test_store_result_via_execute_carries_data

Regression: data must survive the execute() validation pipeline.

test_store_result_via_execute_carries_data()

Alias WorkingMemoryCatalog

Re-exported from parrot.tools.working_memory.internals.WorkingMemoryCatalog.

Alias WorkingMemoryToolkit

Re-exported from parrot.tools.working_memory.WorkingMemoryToolkit.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally