Skip to content

Commit 68074e1

Browse files
authored
making cohere encoder optional (#44)
1 parent 3f20dd8 commit 68074e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

service/router.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def create_route_layer() -> RouteLayer:
2424
score_threshold=0.5,
2525
)
2626
]
27-
encoder = CohereEncoder(cohere_api_key=config("COHERE_API_KEY"))
27+
cohere_api_key = config("COHERE_API_KEY", None)
28+
encoder = CohereEncoder(cohere_api_key=cohere_api_key) if cohere_api_key else None
2829
return RouteLayer(encoder=encoder, routes=routes)
2930

3031

0 commit comments

Comments
 (0)