mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-23 15:19:33 +00:00
Solving anthropic packaging version issue (#7306)
- Description: Solving, anthropic packaging version issue by clearing the mixup from package.version that is being confused with version from - importlib.metadata.version. - Issue: it fixes the issue #7283 - Maintainer: @hwchase17 The following change has been explained in the comment - https://github.com/hwchase17/langchain/issues/7283#issuecomment-1624328978
This commit is contained in:
parent
d642609a23
commit
bac56618b4
@ -4,7 +4,7 @@ import warnings
|
||||
from importlib.metadata import version
|
||||
from typing import Any, Callable, Dict, Generator, List, Mapping, Optional
|
||||
|
||||
import packaging
|
||||
from packaging.version import parse
|
||||
from pydantic import BaseModel, root_validator
|
||||
|
||||
from langchain.callbacks.manager import (
|
||||
@ -64,8 +64,8 @@ class _AnthropicCommon(BaseModel):
|
||||
try:
|
||||
import anthropic
|
||||
|
||||
anthropic_version = packaging.version.parse(version("anthropic"))
|
||||
if anthropic_version < packaging.version.parse("0.3"):
|
||||
anthropic_version = parse(version("anthropic"))
|
||||
if anthropic_version < parse("0.3"):
|
||||
raise ValueError(
|
||||
f"Anthropic client version must be > 0.3, got {anthropic_version}. "
|
||||
f"To update the client, please run "
|
||||
|
Loading…
Reference in New Issue
Block a user