Skip to content

Route reference methods #322

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

rbs333
Copy link
Collaborator

@rbs333 rbs333 commented Apr 17, 2025

This pr add methods so that you can easily get/add/delete route references.

Copy link
Collaborator

@justin-cechmanek justin-cechmanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like some of the cells in the 08_semantic_router notebook are returning no routes. Can we double check this

Comment on lines +161 to +179
@staticmethod
def _connect_to_index(
router_name: str,
vectorizer: BaseVectorizer,
redis_client: Optional[Redis] = None,
redis_url: str = "redis://localhost:6379",
**connection_kwargs,
) -> SearchIndex:
"""Connect to the Redis index."""
schema = SemanticRouterIndexSchema.from_params(
router_name, vectorizer.dims, vectorizer.dtype # type: ignore
)

return SearchIndex(
schema=schema,
redis_client=redis_client,
redis_url=redis_url,
**connection_kwargs,
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to pull this out as a separate method when we only execute this code within _initialize_index()?

redis_client: Optional[Redis] = None,
redis_url: str = "",
) -> int:
"""Get references for an existing route route.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""Get references for an existing route route.
"""Get references for an existing router route.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants