redis / redis/redis-vl-python

Add __repr__ methods to core RedisVL classes

Open
#483 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
427
Forks
101
Avg merge
6d 3h
Merged PRs (30d)
20

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with redisvl/index/index.py, redisvl/extensions/cache/llm/semantic.py, redisvl/extensions/router/semantic.py, and the files under redisvl/extensions/message_history/. Add stable, human-readable repr coverage for the named classes using only non-sensitive fields, then add unit tests for the expected strings. Run make format, make check-types, and the test suite to confirm the definition of done.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, redis
Domain
backend, developer-experience
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.