From dd94fb8ad8132d98aee86e85256dca162a45f89e Mon Sep 17 00:00:00 2001 From: James Briggs <35938317+jamescalam@users.noreply.github.com> Date: Mon, 13 Jan 2025 06:45:59 +0000 Subject: [PATCH] fix: routes --- semantic_router/routers/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/semantic_router/routers/base.py b/semantic_router/routers/base.py index b3ceeed3..fb14aa66 100644 --- a/semantic_router/routers/base.py +++ b/semantic_router/routers/base.py @@ -327,6 +327,7 @@ class BaseRouter(BaseModel): aggregation: str = "mean", auto_sync: Optional[str] = None, ): + routes = routes.copy() if routes else [] super().__init__( encoder=encoder, sparse_encoder=sparse_encoder, @@ -340,7 +341,7 @@ class BaseRouter(BaseModel): self.encoder = self._get_encoder(encoder=encoder) self.sparse_encoder = self._get_sparse_encoder(sparse_encoder=sparse_encoder) self.llm = llm - self.routes = routes.copy() if routes else [] + self.routes = routes # initialize index self.index = self._get_index(index=index) # set score threshold using default method -- GitLab