From 55d48905a74f0b0c0de625ddb7473cef4c85f384 Mon Sep 17 00:00:00 2001 From: Luca <48441989+italianconcerto@users.noreply.github.com> Date: Thu, 14 Dec 2023 16:28:19 +0100 Subject: [PATCH] Update README.md Examples in the Readme updated --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b4b3c0e3..2db0e9b7 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,10 @@ pip install -qU semantic-router We begin by defining a set of `Decision` objects. These are the decision paths that the semantic router can decide to use, let's try two simple decisions for now — one for talk on _politics_ and another for _chitchat_: ```python -from semantic_router.schema import Decision +from semantic_router.schema import Route # we could use this as a guide for our chatbot to avoid political conversations -politics = Decision( +politics = Route( name="politics", utterances=[ "isn't politics the best thing ever", @@ -40,7 +40,7 @@ politics = Decision( # this could be used as an indicator to our chatbot to switch to a more # conversational prompt -chitchat = Decision( +chitchat = Route( name="chitchat", utterances=[ "how's the weather today?", @@ -73,9 +73,9 @@ encoder = OpenAIEncoder() With our `decisions` and `encoder` defined we now create a `DecisionLayer`. The decision layer handles our semantic decision making. ```python -from semantic_router.layer import DecisionLayer +from semantic_router.layer import RouteLayer -dl = DecisionLayer(encoder=encoder, decisions=decisions) +dl = RouteLayer(encoder=encoder, decisions=decisions) ``` We can now use our decision layer to make super fast decisions based on user queries. Let's try with two queries that should trigger our decisions: -- GitLab