Skip to content

Commit

Permalink
chore: switch from pydantic.v1 to pydantic
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescalam committed Nov 30, 2024
1 parent 5461660 commit 1977d06
Show file tree
Hide file tree
Showing 20 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion semantic_router/encoders/aurelio.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion semantic_router/encoders/clip.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion semantic_router/encoders/cohere.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion semantic_router/encoders/fastembed.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion semantic_router/encoders/huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion semantic_router/encoders/mistral.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion semantic_router/encoders/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion semantic_router/index/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion semantic_router/index/pinecone.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion semantic_router/index/qdrant.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion semantic_router/llms/base.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion semantic_router/llms/cohere.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion semantic_router/llms/llamacpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion semantic_router/llms/mistral.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion semantic_router/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion semantic_router/routers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion semantic_router/routers/hybrid.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion semantic_router/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion semantic_router/utils/function_call.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_schema.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from pydantic.v1 import ValidationError
from pydantic import ValidationError

from semantic_router.schema import (
Message,
Expand Down

0 comments on commit 1977d06

Please sign in to comment.