-
Notifications
You must be signed in to change notification settings - Fork 45
Route reference methods #322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
@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, | ||
) |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""Get references for an existing route route. | |
"""Get references for an existing router route. |
This pr add methods so that you can easily get/add/delete route references.