mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-11 13:55:03 +00:00
poetry lock
the experimental package. (#9478)
This commit is contained in:
parent
65e893b9cd
commit
d564ec944c
@ -6,7 +6,6 @@ from __future__ import annotations
|
|||||||
import json
|
import json
|
||||||
from typing import Any, ClassVar, Dict, List, Optional, Type
|
from typing import Any, ClassVar, Dict, List, Optional, Type
|
||||||
|
|
||||||
import pydantic
|
|
||||||
from langchain.base_language import BaseLanguageModel
|
from langchain.base_language import BaseLanguageModel
|
||||||
from langchain.callbacks.manager import CallbackManagerForChainRun
|
from langchain.callbacks.manager import CallbackManagerForChainRun
|
||||||
from langchain.chains.base import Chain
|
from langchain.chains.base import Chain
|
||||||
@ -14,6 +13,7 @@ from langchain.chains.llm import LLMChain
|
|||||||
from langchain.output_parsers import PydanticOutputParser
|
from langchain.output_parsers import PydanticOutputParser
|
||||||
from langchain.prompts.prompt import PromptTemplate
|
from langchain.prompts.prompt import PromptTemplate
|
||||||
|
|
||||||
|
from langchain_experimental import pydantic_v1 as pydantic
|
||||||
from langchain_experimental.cpal.constants import Constant
|
from langchain_experimental.cpal.constants import Constant
|
||||||
from langchain_experimental.cpal.models import (
|
from langchain_experimental.cpal.models import (
|
||||||
CausalModel,
|
CausalModel,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import typing
|
||||||
from importlib import metadata
|
from importlib import metadata
|
||||||
|
|
||||||
## Create namespaces for pydantic v1 and v2.
|
## Create namespaces for pydantic v1 and v2.
|
||||||
@ -11,11 +12,19 @@ from importlib import metadata
|
|||||||
# unambiguously uses either v1 or v2 API.
|
# unambiguously uses either v1 or v2 API.
|
||||||
# * This change is easier to roll out and roll back.
|
# * This change is easier to roll out and roll back.
|
||||||
|
|
||||||
try:
|
# It's currently impossible to support mypy for both pydantic v1 and v2 at once:
|
||||||
from pydantic.v1 import * # noqa: F403
|
# https://github.com/pydantic/pydantic/issues/6022
|
||||||
except ImportError:
|
#
|
||||||
|
# In the lint environment, pydantic is currently v1.
|
||||||
|
# When we upgrade it to pydantic v2, we'll need
|
||||||
|
# to replace this with `from pydantic.v1 import *`.
|
||||||
|
if typing.TYPE_CHECKING:
|
||||||
from pydantic import * # noqa: F403
|
from pydantic import * # noqa: F403
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
from pydantic.v1 import * # noqa: F403
|
||||||
|
except ImportError:
|
||||||
|
from pydantic import * # noqa: F403
|
||||||
|
|
||||||
try:
|
try:
|
||||||
_PYDANTIC_MAJOR_VERSION: int = int(metadata.version("pydantic").split(".")[0])
|
_PYDANTIC_MAJOR_VERSION: int = int(metadata.version("pydantic").split(".")[0])
|
||||||
|
@ -1,4 +1,15 @@
|
|||||||
try:
|
import typing
|
||||||
from pydantic.v1.dataclasses import * # noqa: F403
|
|
||||||
except ImportError:
|
# It's currently impossible to support mypy for both pydantic v1 and v2 at once:
|
||||||
|
# https://github.com/pydantic/pydantic/issues/6022
|
||||||
|
#
|
||||||
|
# In the lint environment, pydantic is currently v1.
|
||||||
|
# When we upgrade it to pydantic v2, we'll need to
|
||||||
|
# replace this with `from pydantic.v1.dataclasses import *`.
|
||||||
|
if typing.TYPE_CHECKING:
|
||||||
from pydantic.dataclasses import * # noqa: F403
|
from pydantic.dataclasses import * # noqa: F403
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
from pydantic.v1.dataclasses import * # noqa: F403
|
||||||
|
except ImportError:
|
||||||
|
from pydantic.dataclasses import * # noqa: F403
|
||||||
|
@ -1,4 +1,15 @@
|
|||||||
try:
|
import typing
|
||||||
from pydantic.v1.main import * # noqa: F403
|
|
||||||
except ImportError:
|
# It's currently impossible to support mypy for both pydantic v1 and v2 at once:
|
||||||
|
# https://github.com/pydantic/pydantic/issues/6022
|
||||||
|
#
|
||||||
|
# In the lint environment, pydantic is currently v1.
|
||||||
|
# When we upgrade it to pydantic v2, we'll need
|
||||||
|
# to replace this with `from pydantic.v1.main import *`.
|
||||||
|
if typing.TYPE_CHECKING:
|
||||||
from pydantic.main import * # noqa: F403
|
from pydantic.main import * # noqa: F403
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
from pydantic.v1.main import * # noqa: F403
|
||||||
|
except ImportError:
|
||||||
|
from pydantic.main import * # noqa: F403
|
||||||
|
826
libs/experimental/poetry.lock
generated
826
libs/experimental/poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@ -5,12 +5,12 @@ import unittest
|
|||||||
from typing import Type
|
from typing import Type
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
import pydantic
|
|
||||||
import pytest
|
import pytest
|
||||||
from langchain import OpenAI
|
from langchain import OpenAI
|
||||||
from langchain.output_parsers import PydanticOutputParser
|
from langchain.output_parsers import PydanticOutputParser
|
||||||
from langchain.prompts.prompt import PromptTemplate
|
from langchain.prompts.prompt import PromptTemplate
|
||||||
|
|
||||||
|
from langchain_experimental import pydantic_v1 as pydantic
|
||||||
from langchain_experimental.cpal.base import (
|
from langchain_experimental.cpal.base import (
|
||||||
CausalChain,
|
CausalChain,
|
||||||
CPALChain,
|
CPALChain,
|
||||||
|
Loading…
Reference in New Issue
Block a user