Skip to content
Snippets Groups Projects
Unverified Commit 5a31fa77 authored by James Briggs's avatar James Briggs
Browse files

merge and lint

parent 0ac1123e
No related branches found
No related tags found
No related merge requests found
Showing
with 21 additions and 19 deletions
...@@ -2,10 +2,10 @@ from semantic_router.encoders.base import BaseEncoder ...@@ -2,10 +2,10 @@ from semantic_router.encoders.base import BaseEncoder
from semantic_router.encoders.bm25 import BM25Encoder from semantic_router.encoders.bm25 import BM25Encoder
from semantic_router.encoders.cohere import CohereEncoder from semantic_router.encoders.cohere import CohereEncoder
from semantic_router.encoders.fastembed import FastEmbedEncoder from semantic_router.encoders.fastembed import FastEmbedEncoder
from semantic_router.encoders.openai import OpenAIEncoder
from semantic_router.encoders.zure import AzureOpenAIEncoder
from semantic_router.encoders.huggingface import HuggingFaceEncoder from semantic_router.encoders.huggingface import HuggingFaceEncoder
from semantic_router.encoders.openai import OpenAIEncoder
from semantic_router.encoders.tfidf import TfidfEncoder from semantic_router.encoders.tfidf import TfidfEncoder
from semantic_router.encoders.zure import AzureOpenAIEncoder
__all__ = [ __all__ = [
"BaseEncoder", "BaseEncoder",
......
from typing import List from typing import List
from pydantic import BaseModel, Field from pydantic import BaseModel, Field
......
from typing import Any, Optional, List, Dict from typing import Any, Dict, List, Optional
from semantic_router.encoders import BaseEncoder from semantic_router.encoders import BaseEncoder
from semantic_router.utils.logger import logger from semantic_router.utils.logger import logger
......
import os import os
from typing import Optional, List from typing import List, Optional
import cohere import cohere
......
from typing import Any, Optional, List from typing import Any, List, Optional
import numpy as np import numpy as np
from pydantic import PrivateAttr from pydantic import PrivateAttr
......
from typing import Any, Optional, List from typing import Any, List, Optional
from pydantic import PrivateAttr from pydantic import PrivateAttr
......
import os import os
from time import sleep from time import sleep
from typing import Optional, List from typing import List, Optional
import openai import openai
from openai import OpenAIError from openai import OpenAIError
......
from typing import Optional, List, Dict, Tuple from typing import Dict, List, Optional, Tuple
import numpy as np import numpy as np
from numpy.linalg import norm from numpy.linalg import norm
......
import json import json
import os import os
from typing import Optional, Any, List, Dict, Tuple from typing import Any, Dict, List, Optional, Tuple
import numpy as np import numpy as np
import yaml import yaml
......
from typing import Optional, List from typing import List, Optional
from pydantic import BaseModel from pydantic import BaseModel
......
import os import os
from typing import Optional, List from typing import List, Optional
import cohere import cohere
......
import os import os
from typing import Optional, List from typing import List, Optional
import openai import openai
......
import os import os
from typing import Optional, List from typing import List, Optional
import openai import openai
......
import json import json
import re import re
from typing import Any, Callable, Optional, Union, List, Dict from typing import Any, Callable, Dict, List, Optional, Union
from pydantic import BaseModel from pydantic import BaseModel
......
from enum import Enum from enum import Enum
from typing import Optional, Literal, List, Dict from typing import Dict, List, Literal, Optional
from pydantic import BaseModel from pydantic import BaseModel
from pydantic.dataclasses import dataclass from pydantic.dataclasses import dataclass
......
import inspect import inspect
import json import json
from typing import Any, Callable, Union, Dict, List from typing import Any, Callable, Dict, List, Union
from pydantic import BaseModel from pydantic import BaseModel
......
from typing import Dict, List, Literal
import numpy as np import numpy as np
from typing import List, Dict, Literal
from semantic_router.encoders import BaseEncoder from semantic_router.encoders import BaseEncoder
......
...@@ -44,7 +44,6 @@ def openai_encoder(mocker): ...@@ -44,7 +44,6 @@ def openai_encoder(mocker):
@pytest.fixture @pytest.fixture
def azure_encoder(mocker): def azure_encoder(mocker):
mocker.patch.object(AzureOpenAIEncoder, "__call__", side_effect=mock_encoder_call) mocker.patch.object(AzureOpenAIEncoder, "__call__", side_effect=mock_encoder_call)
return AzureOpenAIEncoder( return AzureOpenAIEncoder(
...@@ -55,17 +54,18 @@ def azure_encoder(mocker): ...@@ -55,17 +54,18 @@ def azure_encoder(mocker):
model="test_model", model="test_model",
) )
def bm25_encoder(mocker): def bm25_encoder(mocker):
mocker.patch.object(BM25Encoder, "__call__", side_effect=mock_encoder_call) mocker.patch.object(BM25Encoder, "__call__", side_effect=mock_encoder_call)
return BM25Encoder(name="test-bm25-encoder") return BM25Encoder(name="test-bm25-encoder")
@pytest.fixture @pytest.fixture
def tfidf_encoder(mocker): def tfidf_encoder(mocker):
mocker.patch.object(TfidfEncoder, "__call__", side_effect=mock_encoder_call) mocker.patch.object(TfidfEncoder, "__call__", side_effect=mock_encoder_call)
return TfidfEncoder(name="test-tfidf-encoder") return TfidfEncoder(name="test-tfidf-encoder")
@pytest.fixture @pytest.fixture
def routes(): def routes():
return [ return [
......
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