Skip to content

Commit c7b371a

Browse files
committed
Updated LLMMessage deprecation warning
1 parent 9d40495 commit c7b371a

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/neo4j_graphrag/llm/types.py

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import warnings
2-
from typing import Literal
2+
from typing import Any, Literal
33

44
from pydantic import BaseModel
55

66
from neo4j_graphrag.types import LLMMessage as _LLMMessage
77

8-
warnings.warn(
9-
"LLMMessage has been moved to neo4j_graphrag.types. Please update your imports.",
10-
DeprecationWarning,
11-
stacklevel=2,
12-
)
13-
LLMMessage = _LLMMessage
8+
9+
def __getattr__(name: str) -> Any:
10+
if name == "LLMMessage":
11+
warnings.warn(
12+
"LLMMessage has been moved to neo4j_graphrag.types. Please update your imports.",
13+
DeprecationWarning,
14+
stacklevel=2,
15+
)
16+
return _LLMMessage
17+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
1418

1519

1620
class LLMResponse(BaseModel):

0 commit comments

Comments
 (0)