Skip to content
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

Router Save and Load #336

Open
fadi212 opened this issue Jul 1, 2024 · 2 comments
Open

Router Save and Load #336

fadi212 opened this issue Jul 1, 2024 · 2 comments

Comments

@fadi212
Copy link

fadi212 commented Jul 1, 2024

I am trying to save the router using rl.to_yaml and then when I load it, it does not work ?
Does the semantic router have no support for saving and loading both index and routers ?
Because every time I have to initialize the index and router.

I am trying to convert it into an API but it is creating the above issue.

@abnerjacobsen
Copy link

abnerjacobsen commented Jul 9, 2024

Hi @fadi212 ,

I had a similar need, in my case I saved the routes in JSON and then needed to load the JSON to populate the vectors in Qdrant through a script. I solved it this way:

from semantic_router.index.qdrant import QdrantIndex
from semantic_router.layer import LayerConfig, RouteLayer

layer_config = LayerConfig.from_file("./semantic_routes_daschat.json")

qd_index = QdrantIndex(
    index_name="dasbothub",
    location="http://0.0.0.0",
    port=6333,
    prefer_grpc=False,
    https=False,
    api_key="1245436547",
)

layer = RouteLayer.from_config(config=layer_config, index=qd_index)

@shankara-93
Copy link

how to save both index and routers in first places... and load it into QdrantIndex.. Ref: #53

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

No branches or pull requests

3 participants