We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I see that top_k=5 is hardcoded for the HybridRouteLayer class:
top_k=5
HybridRouteLayer
semantic-router/semantic_router/hybrid_layer.py
Line 51 in 1e753d9
Which is possible to set through the _query method:
_query
Line 124 in 1e753d9
I believe being able to set top_k would be of value to achieve better performance in some use cases.
top_k
The text was updated successfully, but these errors were encountered:
The feature has been merged but has yet to be part of a release. For now, install from source to get feature.
Below is an example on how to set top_k:
from semantic_router.encoders import AzureOpenAIEncoder, TfidfEncoder from semantic_router.hybrid_layer import HybridRouteLayer model = HybridRouteLayer( encoder=AzureOpenAIEncoder(...), sparse_encoder=TfidfEncoder(), routes=routes, alpha=0.3, # default = 0.3 top_k=3, # default = 5 )
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
I see that
top_k=5
is hardcoded for theHybridRouteLayer
class:semantic-router/semantic_router/hybrid_layer.py
Line 51 in 1e753d9
Which is possible to set through the
_query
method:semantic-router/semantic_router/hybrid_layer.py
Line 124 in 1e753d9
I believe being able to set
top_k
would be of value to achieve better performance in some use cases.The text was updated successfully, but these errors were encountered: