Skip to content

Add __repr__ methods to core RedisVL classes #483

Open

Description

@tylerhutcherson

Summary

Add useful __repr__ implementations for core RedisVL classes to improve debugging and developer ergonomics.

Level: Beginner

Current State

  • Core objects currently use default object repr output (<Class object at 0x...>).
  • This makes notebook debugging, test output, and agent-generated diagnostics hard to read.

Proposed Change

  • Add concise, deterministic __repr__ methods to:
    • SearchIndex / AsyncSearchIndex in redisvl/index/index.py
    • SemanticCache in redisvl/extensions/cache/llm/semantic.py
    • SemanticRouter in redisvl/extensions/router/semantic.py
    • MessageHistory / SemanticMessageHistory in redisvl/extensions/message_history/
  • Include only non-sensitive fields (name, prefix, storage type, counts).

Definition of Done

  • Repr output is human-readable and stable.
  • New unit tests verify expected repr strings.
  • make format, make check-types, and tests pass.

Out of Scope

  • Changing runtime behavior or API signatures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions