diff --git a/semantic_router/encoders/aurelio.py b/semantic_router/encoders/aurelio.py index 8b2501ba..c50c6c4e 100644 --- a/semantic_router/encoders/aurelio.py +++ b/semantic_router/encoders/aurelio.py @@ -1,6 +1,6 @@ import os from typing import Any, List, Optional -from pydantic.v1 import Field +from pydantic import Field from aurelio_sdk import AurelioClient, AsyncAurelioClient, EmbeddingResponse diff --git a/semantic_router/encoders/clip.py b/semantic_router/encoders/clip.py index d30f5e1f..065ff115 100644 --- a/semantic_router/encoders/clip.py +++ b/semantic_router/encoders/clip.py @@ -1,7 +1,7 @@ from typing import Any, List, Optional import numpy as np -from pydantic.v1 import PrivateAttr +from pydantic import PrivateAttr from typing import Dict from semantic_router.encoders import DenseEncoder diff --git a/semantic_router/encoders/cohere.py b/semantic_router/encoders/cohere.py index 04b87814..e919bae1 100644 --- a/semantic_router/encoders/cohere.py +++ b/semantic_router/encoders/cohere.py @@ -1,7 +1,7 @@ import os from typing import Any, List, Optional -from pydantic.v1 import PrivateAttr +from pydantic import PrivateAttr from semantic_router.encoders import DenseEncoder from semantic_router.utils.defaults import EncoderDefault diff --git a/semantic_router/encoders/fastembed.py b/semantic_router/encoders/fastembed.py index 5cda5e64..2c997795 100644 --- a/semantic_router/encoders/fastembed.py +++ b/semantic_router/encoders/fastembed.py @@ -1,7 +1,7 @@ from typing import Any, List, Optional import numpy as np -from pydantic.v1 import PrivateAttr +from pydantic import PrivateAttr from semantic_router.encoders import DenseEncoder diff --git a/semantic_router/encoders/huggingface.py b/semantic_router/encoders/huggingface.py index c791e1c3..f553a082 100644 --- a/semantic_router/encoders/huggingface.py +++ b/semantic_router/encoders/huggingface.py @@ -25,7 +25,7 @@ import os from typing import Any, List, Optional, Dict -from pydantic.v1 import PrivateAttr +from pydantic import PrivateAttr from semantic_router.encoders import DenseEncoder from semantic_router.utils.logger import logger diff --git a/semantic_router/encoders/mistral.py b/semantic_router/encoders/mistral.py index 46bc89ae..6c3a2f5e 100644 --- a/semantic_router/encoders/mistral.py +++ b/semantic_router/encoders/mistral.py @@ -4,7 +4,7 @@ from time import sleep from typing import Any, List, Optional -from pydantic.v1 import PrivateAttr +from pydantic import PrivateAttr from semantic_router.encoders import DenseEncoder from semantic_router.utils.defaults import EncoderDefault diff --git a/semantic_router/encoders/openai.py b/semantic_router/encoders/openai.py index fb8a83f0..065e32b7 100644 --- a/semantic_router/encoders/openai.py +++ b/semantic_router/encoders/openai.py @@ -2,7 +2,7 @@ import os from time import sleep from typing import Any, List, Optional, Union -from pydantic.v1 import PrivateAttr +from pydantic import PrivateAttr import openai from openai import OpenAIError diff --git a/semantic_router/index/base.py b/semantic_router/index/base.py index 97fe3bd4..884106c0 100644 --- a/semantic_router/index/base.py +++ b/semantic_router/index/base.py @@ -2,7 +2,7 @@ import json import numpy as np -from pydantic.v1 import BaseModel +from pydantic import BaseModel from semantic_router.schema import ConfigParameter, SparseEmbedding, Utterance from semantic_router.route import Route diff --git a/semantic_router/index/pinecone.py b/semantic_router/index/pinecone.py index 303b4715..b4ba144e 100644 --- a/semantic_router/index/pinecone.py +++ b/semantic_router/index/pinecone.py @@ -8,7 +8,7 @@ from typing import Any, Dict, List, Optional, Union, Tuple import numpy as np -from pydantic.v1 import BaseModel, Field +from pydantic import BaseModel, Field from semantic_router.index.base import BaseIndex from semantic_router.schema import ConfigParameter, SparseEmbedding diff --git a/semantic_router/index/qdrant.py b/semantic_router/index/qdrant.py index 0da5c25e..12337eda 100644 --- a/semantic_router/index/qdrant.py +++ b/semantic_router/index/qdrant.py @@ -1,7 +1,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union import numpy as np -from pydantic.v1 import Field +from pydantic import Field from semantic_router.index.base import BaseIndex from semantic_router.schema import ConfigParameter, Metric, SparseEmbedding, Utterance diff --git a/semantic_router/llms/base.py b/semantic_router/llms/base.py index bbd39b4e..02ea2777 100644 --- a/semantic_router/llms/base.py +++ b/semantic_router/llms/base.py @@ -1,7 +1,7 @@ import json from typing import Any, List, Optional, Dict -from pydantic.v1 import BaseModel +from pydantic import BaseModel from semantic_router.schema import Message from semantic_router.utils.logger import logger diff --git a/semantic_router/llms/cohere.py b/semantic_router/llms/cohere.py index 05a9b1bd..d37f979d 100644 --- a/semantic_router/llms/cohere.py +++ b/semantic_router/llms/cohere.py @@ -1,7 +1,7 @@ import os from typing import Any, List, Optional -from pydantic.v1 import PrivateAttr +from pydantic import PrivateAttr from semantic_router.llms import BaseLLM from semantic_router.schema import Message diff --git a/semantic_router/llms/llamacpp.py b/semantic_router/llms/llamacpp.py index 102f7fff..8431be14 100644 --- a/semantic_router/llms/llamacpp.py +++ b/semantic_router/llms/llamacpp.py @@ -2,7 +2,7 @@ from pathlib import Path from typing import Any, Optional, List, Dict -from pydantic.v1 import PrivateAttr +from pydantic import PrivateAttr from semantic_router.llms.base import BaseLLM from semantic_router.schema import Message diff --git a/semantic_router/llms/mistral.py b/semantic_router/llms/mistral.py index 8ddd1482..732cd7b1 100644 --- a/semantic_router/llms/mistral.py +++ b/semantic_router/llms/mistral.py @@ -1,7 +1,7 @@ import os from typing import Any, List, Optional -from pydantic.v1 import PrivateAttr +from pydantic import PrivateAttr from semantic_router.llms import BaseLLM from semantic_router.schema import Message diff --git a/semantic_router/route.py b/semantic_router/route.py index 50d516fa..7008ff00 100644 --- a/semantic_router/route.py +++ b/semantic_router/route.py @@ -2,7 +2,7 @@ import re from typing import Any, Callable, Dict, List, Optional, Union -from pydantic.v1 import BaseModel +from pydantic import BaseModel from semantic_router.llms import BaseLLM from semantic_router.schema import Message, RouteChoice diff --git a/semantic_router/routers/base.py b/semantic_router/routers/base.py index e4376b42..3628fda8 100644 --- a/semantic_router/routers/base.py +++ b/semantic_router/routers/base.py @@ -4,7 +4,7 @@ import random import hashlib from typing import Any, Callable, Dict, List, Optional, Tuple, Union -from pydantic.v1 import BaseModel, Field +from pydantic import BaseModel, Field import numpy as np import yaml # type: ignore diff --git a/semantic_router/routers/hybrid.py b/semantic_router/routers/hybrid.py index 36ccd8f9..994fcb2d 100644 --- a/semantic_router/routers/hybrid.py +++ b/semantic_router/routers/hybrid.py @@ -1,6 +1,6 @@ from typing import Dict, List, Optional import asyncio -from pydantic.v1 import Field +from pydantic import Field import numpy as np diff --git a/semantic_router/schema.py b/semantic_router/schema.py index c9e63943..adb881fa 100644 --- a/semantic_router/schema.py +++ b/semantic_router/schema.py @@ -3,7 +3,7 @@ from enum import Enum import numpy as np from typing import List, Optional, Union, Any, Dict, Tuple -from pydantic.v1 import BaseModel, Field +from pydantic import BaseModel, Field from semantic_router.utils.logger import logger from aurelio_sdk.schema import BM25Embedding diff --git a/semantic_router/utils/function_call.py b/semantic_router/utils/function_call.py index d03c0798..f5fd5a87 100644 --- a/semantic_router/utils/function_call.py +++ b/semantic_router/utils/function_call.py @@ -1,7 +1,7 @@ import inspect from typing import Any, Callable, Dict, List, Optional, Union -from pydantic.v1 import BaseModel +from pydantic import BaseModel from semantic_router.llms import BaseLLM from semantic_router.schema import Message, RouteChoice diff --git a/tests/unit/test_schema.py b/tests/unit/test_schema.py index d0fce781..bd5d9729 100644 --- a/tests/unit/test_schema.py +++ b/tests/unit/test_schema.py @@ -1,5 +1,5 @@ import pytest -from pydantic.v1 import ValidationError +from pydantic import ValidationError from semantic_router.schema import ( Message,