I am trying to initialize vertexai llm in langchain library.
from langchain_community.llms.vertexai import VertexAI
llm = VertexAI(
max_output_tokens=1024,
temperature=0.2,
top_p=0.8,
top_k=40,
verbose=True,
)
I get the following error with this.
ConfigError: field “client” not yet prepared so the type is still a
ForwardRef, you might need to call VertexAI.update_forward_refs().
And when I called this function I got.
NameError: name ‘_LanguageModel’ is not defined
I also went through the source code and tried importing _LanguageModel manually just before the code but it’s not working.
How can I resolve this?