Skip to content
Snippets Groups Projects
Unverified Commit 2980694c authored by James Briggs's avatar James Briggs Committed by GitHub
Browse files

Update README.md

parent 4f1567ed
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ pip install -qU semantic-router ...@@ -24,7 +24,7 @@ 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_: 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 ```python
from semantic_router.schema import Route from semantic_router import Route
# we could use this as a guide for our chatbot to avoid political conversations # we could use this as a guide for our chatbot to avoid political conversations
politics = Route( politics = Route(
...@@ -81,7 +81,7 @@ dl = RouteLayer(encoder=encoder, decisions=decisions) ...@@ -81,7 +81,7 @@ 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: 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:
```python ```python
dl("don't you love politics?") dl("don't you love politics?").name
``` ```
``` ```
...@@ -91,7 +91,7 @@ dl("don't you love politics?") ...@@ -91,7 +91,7 @@ dl("don't you love politics?")
Correct decision, let's try another: Correct decision, let's try another:
```python ```python
dl("how's the weather today?") dl("how's the weather today?").name
``` ```
``` ```
...@@ -101,7 +101,7 @@ dl("how's the weather today?") ...@@ -101,7 +101,7 @@ dl("how's the weather today?")
We get both decisions correct! Now lets try sending an unrelated query: We get both decisions correct! Now lets try sending an unrelated query:
```python ```python
dl("I'm interested in learning about llama 2") dl("I'm interested in learning about llama 2").name
``` ```
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment