semantic-router 0.1.0.dev7__tar.gz → 0.1.0.dev9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/PKG-INFO +1 -1
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/pyproject.toml +1 -1
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/__init__.py +2 -2
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/__init__.py +1 -2
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/aurelio.py +2 -2
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/bedrock.py +3 -1
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/clip.py +2 -2
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/huggingface.py +3 -3
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/openai.py +3 -4
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/index/base.py +4 -5
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/index/hybrid_local.py +2 -3
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/index/local.py +2 -3
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/index/pinecone.py +3 -4
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/index/postgres.py +1 -1
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/llms/base.py +1 -1
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/llms/llamacpp.py +1 -1
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/llms/openai.py +11 -11
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/llms/openrouter.py +1 -2
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/routers/base.py +16 -8
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/routers/hybrid.py +15 -11
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/schema.py +5 -3
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/utils/function_call.py +1 -2
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/LICENSE +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/README.md +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/base.py +1 -1
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/bm25.py +2 -2
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/cohere.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/fastembed.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/google.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/mistral.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/tfidf.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/vit.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/zure.py +2 -2
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/index/__init__.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/index/qdrant.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/linear.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/llms/__init__.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/llms/cohere.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/llms/grammars/json.gbnf +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/llms/mistral.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/llms/ollama.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/llms/zure.py +1 -1
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/py.typed +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/route.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/routers/__init__.py +1 -1
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/routers/semantic.py +1 -1
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/utils/__init__.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/utils/defaults.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/utils/llm.py +0 -0
- {semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/utils/logger.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
from semantic_router.routers import RouterConfig, SemanticRouter, HybridRouter
|
|
2
1
|
from semantic_router.route import Route
|
|
2
|
+
from semantic_router.routers import HybridRouter, RouterConfig, SemanticRouter
|
|
3
3
|
|
|
4
4
|
__all__ = ["SemanticRouter", "HybridRouter", "Route", "RouterConfig"]
|
|
5
5
|
|
|
6
|
-
__version__ = "0.1.0.
|
|
6
|
+
__version__ = "0.1.0.dev9"
|
{semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/__init__.py
RENAMED
|
@@ -8,8 +8,7 @@ from semantic_router.encoders.clip import CLIPEncoder
|
|
|
8
8
|
from semantic_router.encoders.cohere import CohereEncoder
|
|
9
9
|
from semantic_router.encoders.fastembed import FastEmbedEncoder
|
|
10
10
|
from semantic_router.encoders.google import GoogleEncoder
|
|
11
|
-
from semantic_router.encoders.huggingface import HuggingFaceEncoder
|
|
12
|
-
from semantic_router.encoders.huggingface import HFEndpointEncoder
|
|
11
|
+
from semantic_router.encoders.huggingface import HFEndpointEncoder, HuggingFaceEncoder
|
|
13
12
|
from semantic_router.encoders.mistral import MistralEncoder
|
|
14
13
|
from semantic_router.encoders.openai import OpenAIEncoder
|
|
15
14
|
from semantic_router.encoders.tfidf import TfidfEncoder
|
{semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/aurelio.py
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import os
|
|
2
2
|
from typing import Any, List, Optional
|
|
3
|
-
from pydantic import Field
|
|
4
3
|
|
|
5
|
-
from aurelio_sdk import
|
|
4
|
+
from aurelio_sdk import AsyncAurelioClient, AurelioClient, EmbeddingResponse
|
|
5
|
+
from pydantic import Field
|
|
6
6
|
|
|
7
7
|
from semantic_router.encoders.base import SparseEncoder
|
|
8
8
|
from semantic_router.schema import SparseEmbedding
|
{semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/bedrock.py
RENAMED
|
@@ -17,10 +17,12 @@ Classes:
|
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
19
|
import json
|
|
20
|
-
from typing import Dict, List, Optional, Any, Union
|
|
21
20
|
import os
|
|
22
21
|
from time import sleep
|
|
22
|
+
from typing import Any, Dict, List, Optional, Union
|
|
23
|
+
|
|
23
24
|
import tiktoken
|
|
25
|
+
|
|
24
26
|
from semantic_router.encoders import DenseEncoder
|
|
25
27
|
from semantic_router.utils.defaults import EncoderDefault
|
|
26
28
|
from semantic_router.utils.logger import logger
|
{semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/huggingface.py
RENAMED
|
@@ -20,11 +20,11 @@ Classes:
|
|
|
20
20
|
HFEndpointEncoder: A class for generating embeddings using a Huggingface endpoint.
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
|
-
import requests
|
|
24
|
-
import time
|
|
25
23
|
import os
|
|
26
|
-
|
|
24
|
+
import time
|
|
25
|
+
from typing import Any, Dict, List, Optional
|
|
27
26
|
|
|
27
|
+
import requests
|
|
28
28
|
from pydantic import PrivateAttr
|
|
29
29
|
|
|
30
30
|
from semantic_router.encoders import DenseEncoder
|
{semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/openai.py
RENAMED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
from asyncio import sleep as asleep
|
|
2
1
|
import os
|
|
2
|
+
from asyncio import sleep as asleep
|
|
3
3
|
from time import sleep
|
|
4
4
|
from typing import Any, List, Optional, Union
|
|
5
|
-
from pydantic import PrivateAttr
|
|
6
5
|
|
|
7
6
|
import openai
|
|
7
|
+
import tiktoken
|
|
8
8
|
from openai import OpenAIError
|
|
9
9
|
from openai._types import NotGiven
|
|
10
10
|
from openai.types import CreateEmbeddingResponse
|
|
11
|
-
import
|
|
11
|
+
from pydantic import PrivateAttr
|
|
12
12
|
|
|
13
13
|
from semantic_router.encoders import DenseEncoder
|
|
14
14
|
from semantic_router.schema import EncoderInfo
|
|
15
15
|
from semantic_router.utils.defaults import EncoderDefault
|
|
16
16
|
from semantic_router.utils.logger import logger
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
model_configs = {
|
|
20
19
|
"text-embedding-ada-002": EncoderInfo(
|
|
21
20
|
name="text-embedding-ada-002",
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
-
from datetime import datetime
|
|
3
|
-
import time
|
|
4
|
-
from typing import Any, List, Optional, Tuple, Union, Dict
|
|
5
2
|
import json
|
|
3
|
+
import time
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
6
6
|
|
|
7
7
|
import numpy as np
|
|
8
8
|
from pydantic import BaseModel
|
|
9
9
|
|
|
10
|
-
from semantic_router.schema import ConfigParameter, SparseEmbedding, Utterance
|
|
11
10
|
from semantic_router.route import Route
|
|
11
|
+
from semantic_router.schema import ConfigParameter, SparseEmbedding, Utterance
|
|
12
12
|
from semantic_router.utils.logger import logger
|
|
13
13
|
|
|
14
|
-
|
|
15
14
|
RETRY_WAIT_TIME = 2.5
|
|
16
15
|
|
|
17
16
|
|
{semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/index/hybrid_local.py
RENAMED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
from typing import List, Optional, Tuple
|
|
1
|
+
from typing import Any, Dict, List, Optional, Tuple
|
|
2
2
|
|
|
3
3
|
import numpy as np
|
|
4
4
|
from numpy.linalg import norm
|
|
5
5
|
|
|
6
|
-
from semantic_router.schema import ConfigParameter, SparseEmbedding, Utterance
|
|
7
6
|
from semantic_router.index.local import LocalIndex
|
|
7
|
+
from semantic_router.schema import ConfigParameter, SparseEmbedding, Utterance
|
|
8
8
|
from semantic_router.utils.logger import logger
|
|
9
|
-
from typing import Any
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
class HybridLocalIndex(LocalIndex):
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
from typing import List, Optional, Tuple
|
|
1
|
+
from typing import Any, Dict, List, Optional, Tuple
|
|
2
2
|
|
|
3
3
|
import numpy as np
|
|
4
4
|
|
|
5
|
-
from semantic_router.schema import ConfigParameter, SparseEmbedding, Utterance
|
|
6
5
|
from semantic_router.index.base import BaseIndex, IndexConfig
|
|
7
6
|
from semantic_router.linear import similarity_matrix, top_scores
|
|
7
|
+
from semantic_router.schema import ConfigParameter, SparseEmbedding, Utterance
|
|
8
8
|
from semantic_router.utils.logger import logger
|
|
9
|
-
from typing import Any
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
class LocalIndex(BaseIndex):
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import aiohttp
|
|
2
1
|
import asyncio
|
|
3
2
|
import hashlib
|
|
3
|
+
import json
|
|
4
4
|
import os
|
|
5
5
|
import time
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
from typing import Any, Dict, List, Optional, Union, Tuple
|
|
6
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
9
7
|
|
|
8
|
+
import aiohttp
|
|
10
9
|
import numpy as np
|
|
11
10
|
from pydantic import BaseModel, Field
|
|
12
11
|
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
+
import inspect
|
|
2
|
+
import json
|
|
1
3
|
import os
|
|
2
|
-
|
|
3
|
-
from
|
|
4
|
+
import re
|
|
5
|
+
from typing import Any, Callable, Dict, List, Optional, Union
|
|
4
6
|
|
|
5
7
|
import openai
|
|
6
|
-
from openai._types import
|
|
8
|
+
from openai._types import NOT_GIVEN, NotGiven
|
|
9
|
+
from openai.types.chat.chat_completion_message_tool_call import (
|
|
10
|
+
ChatCompletionMessageToolCall,
|
|
11
|
+
)
|
|
12
|
+
from pydantic import PrivateAttr
|
|
7
13
|
|
|
8
14
|
from semantic_router.llms import BaseLLM
|
|
9
15
|
from semantic_router.schema import Message
|
|
10
16
|
from semantic_router.utils.defaults import EncoderDefault
|
|
11
|
-
from semantic_router.utils.logger import logger
|
|
12
|
-
import json
|
|
13
17
|
from semantic_router.utils.function_call import (
|
|
14
|
-
get_schema,
|
|
15
18
|
convert_python_type_to_json_type,
|
|
19
|
+
get_schema,
|
|
16
20
|
)
|
|
17
|
-
import
|
|
18
|
-
import re
|
|
19
|
-
from openai.types.chat.chat_completion_message_tool_call import (
|
|
20
|
-
ChatCompletionMessageToolCall,
|
|
21
|
-
)
|
|
21
|
+
from semantic_router.utils.logger import logger
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
class OpenAILLM(BaseLLM):
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import hashlib
|
|
1
2
|
import importlib
|
|
2
3
|
import json
|
|
3
4
|
import os
|
|
4
5
|
import random
|
|
5
|
-
import hashlib
|
|
6
6
|
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
|
7
|
-
from typing_extensions import deprecated
|
|
8
|
-
from pydantic import BaseModel, Field
|
|
9
7
|
|
|
10
8
|
import numpy as np
|
|
11
9
|
import yaml # type: ignore
|
|
10
|
+
from pydantic import BaseModel, Field
|
|
12
11
|
from tqdm.auto import tqdm
|
|
12
|
+
from typing_extensions import deprecated
|
|
13
13
|
|
|
14
14
|
from semantic_router.encoders import (
|
|
15
15
|
AutoEncoder,
|
|
@@ -1086,7 +1086,11 @@ class BaseRouter(BaseModel):
|
|
|
1086
1086
|
route_names = [route.name for route in routes for _ in route.utterances]
|
|
1087
1087
|
utterances = [utterance for route in routes for utterance in route.utterances]
|
|
1088
1088
|
function_schemas = [
|
|
1089
|
-
|
|
1089
|
+
(
|
|
1090
|
+
route.function_schemas[0]
|
|
1091
|
+
if route.function_schemas and len(route.function_schemas) > 0
|
|
1092
|
+
else {}
|
|
1093
|
+
)
|
|
1090
1094
|
for route in routes
|
|
1091
1095
|
for _ in route.utterances
|
|
1092
1096
|
]
|
|
@@ -1343,11 +1347,15 @@ class BaseRouter(BaseModel):
|
|
|
1343
1347
|
# Switch to a local index for fitting
|
|
1344
1348
|
from semantic_router.index.local import LocalIndex
|
|
1345
1349
|
|
|
1346
|
-
|
|
1350
|
+
remote_utterances = self.index.get_utterances(include_metadata=True)
|
|
1347
1351
|
# TODO Enhance by retrieving directly the vectors instead of embedding all utterances again
|
|
1348
|
-
routes
|
|
1349
|
-
|
|
1350
|
-
|
|
1352
|
+
routes = []
|
|
1353
|
+
utterances = []
|
|
1354
|
+
metadata = []
|
|
1355
|
+
for utterance in remote_utterances:
|
|
1356
|
+
routes.append(utterance.route)
|
|
1357
|
+
utterances.append(utterance.utterance)
|
|
1358
|
+
metadata.append(utterance.metadata)
|
|
1351
1359
|
embeddings = self.encoder(utterances)
|
|
1352
1360
|
self.index = LocalIndex()
|
|
1353
1361
|
self.index.add(
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
from typing import Any, Dict, List, Optional, Union
|
|
2
|
-
from tqdm.auto import tqdm
|
|
3
1
|
import asyncio
|
|
4
|
-
from
|
|
2
|
+
from typing import Any, Dict, List, Optional, Union
|
|
5
3
|
|
|
6
4
|
import numpy as np
|
|
5
|
+
from pydantic import Field
|
|
6
|
+
from tqdm.auto import tqdm
|
|
7
7
|
|
|
8
8
|
from semantic_router.encoders import (
|
|
9
|
+
BM25Encoder,
|
|
9
10
|
DenseEncoder,
|
|
10
11
|
SparseEncoder,
|
|
11
|
-
BM25Encoder,
|
|
12
12
|
TfidfEncoder,
|
|
13
13
|
)
|
|
14
|
-
from semantic_router.route import Route
|
|
15
14
|
from semantic_router.index import BaseIndex, HybridLocalIndex
|
|
15
|
+
from semantic_router.llms import BaseLLM
|
|
16
|
+
from semantic_router.route import Route
|
|
17
|
+
from semantic_router.routers.base import BaseRouter, threshold_random_search, xq_reshape
|
|
16
18
|
from semantic_router.schema import RouteChoice, SparseEmbedding, Utterance
|
|
17
19
|
from semantic_router.utils.logger import logger
|
|
18
|
-
from semantic_router.routers.base import BaseRouter, xq_reshape, threshold_random_search
|
|
19
|
-
from semantic_router.llms import BaseLLM
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class HybridRouter(BaseRouter):
|
|
@@ -286,11 +286,15 @@ class HybridRouter(BaseRouter):
|
|
|
286
286
|
# Switch to a local index for fitting
|
|
287
287
|
from semantic_router.index.hybrid_local import HybridLocalIndex
|
|
288
288
|
|
|
289
|
-
|
|
289
|
+
remote_utterances = self.index.get_utterances(include_metadata=True)
|
|
290
290
|
# TODO Enhance by retrieving directly the vectors instead of embedding all utterances again
|
|
291
|
-
routes
|
|
292
|
-
|
|
293
|
-
|
|
291
|
+
routes = []
|
|
292
|
+
utterances = []
|
|
293
|
+
metadata = []
|
|
294
|
+
for utterance in remote_utterances:
|
|
295
|
+
routes.append(utterance.route)
|
|
296
|
+
utterances.append(utterance.utterance)
|
|
297
|
+
metadata.append(utterance.metadata)
|
|
294
298
|
embeddings = self.encoder(utterances)
|
|
295
299
|
sparse_embeddings = self.sparse_encoder(utterances)
|
|
296
300
|
self.index = HybridLocalIndex()
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import json
|
|
1
2
|
from datetime import datetime, timezone
|
|
2
3
|
from difflib import Differ
|
|
3
4
|
from enum import Enum
|
|
4
|
-
import
|
|
5
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
6
|
+
|
|
5
7
|
import numpy as np
|
|
6
|
-
from
|
|
8
|
+
from aurelio_sdk.schema import BM25Embedding
|
|
7
9
|
from pydantic import BaseModel, Field
|
|
10
|
+
|
|
8
11
|
from semantic_router.utils.logger import logger
|
|
9
|
-
from aurelio_sdk.schema import BM25Embedding
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
class EncoderType(Enum):
|
{semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/utils/function_call.py
RENAMED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import inspect
|
|
2
2
|
from typing import Any, Callable, Dict, List, Optional, Union
|
|
3
3
|
|
|
4
|
-
from pydantic import BaseModel
|
|
4
|
+
from pydantic import BaseModel, Field
|
|
5
5
|
|
|
6
6
|
from semantic_router.llms import BaseLLM
|
|
7
7
|
from semantic_router.schema import Message, RouteChoice
|
|
8
8
|
from semantic_router.utils.logger import logger
|
|
9
|
-
from pydantic import Field
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
class Parameter(BaseModel):
|
|
File without changes
|
|
File without changes
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from typing import Any, Dict, List, Optional
|
|
2
2
|
|
|
3
3
|
from semantic_router.encoders.tfidf import TfidfEncoder
|
|
4
|
-
from semantic_router.utils.logger import logger
|
|
5
|
-
from semantic_router.schema import SparseEmbedding
|
|
6
4
|
from semantic_router.route import Route
|
|
5
|
+
from semantic_router.schema import SparseEmbedding
|
|
6
|
+
from semantic_router.utils.logger import logger
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class BM25Encoder(TfidfEncoder):
|
{semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/cohere.py
RENAMED
|
File without changes
|
{semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/fastembed.py
RENAMED
|
File without changes
|
{semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/google.py
RENAMED
|
File without changes
|
{semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/encoders/mistral.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
from asyncio import sleep as asleep
|
|
2
1
|
import os
|
|
2
|
+
from asyncio import sleep as asleep
|
|
3
3
|
from time import sleep
|
|
4
4
|
from typing import List, Optional, Union
|
|
5
5
|
|
|
6
6
|
import openai
|
|
7
|
-
from openai._types import NotGiven
|
|
8
7
|
from openai import OpenAIError
|
|
8
|
+
from openai._types import NotGiven
|
|
9
9
|
from openai.types import CreateEmbeddingResponse
|
|
10
10
|
|
|
11
11
|
from semantic_router.encoders import DenseEncoder
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/llms/grammars/json.gbnf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/routers/__init__.py
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from semantic_router.routers.base import BaseRouter, RouterConfig
|
|
2
|
-
from semantic_router.routers.semantic import SemanticRouter
|
|
3
2
|
from semantic_router.routers.hybrid import HybridRouter
|
|
3
|
+
from semantic_router.routers.semantic import SemanticRouter
|
|
4
4
|
|
|
5
5
|
__all__ = [
|
|
6
6
|
"BaseRouter",
|
{semantic_router-0.1.0.dev7 → semantic_router-0.1.0.dev9}/semantic_router/routers/semantic.py
RENAMED
|
@@ -5,9 +5,9 @@ import numpy as np
|
|
|
5
5
|
from semantic_router.encoders import DenseEncoder
|
|
6
6
|
from semantic_router.index.base import BaseIndex
|
|
7
7
|
from semantic_router.llms import BaseLLM
|
|
8
|
-
from semantic_router.utils.logger import logger
|
|
9
8
|
from semantic_router.route import Route
|
|
10
9
|
from semantic_router.routers.base import BaseRouter
|
|
10
|
+
from semantic_router.utils.logger import logger
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class SemanticRouter(BaseRouter):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|