mirror of
https://github.com/hwchase17/langchain
synced 2024-11-04 06:00:26 +00:00
fix missing _identifying_params() in _VertexAICommon (#8303)
Full set of params are missing from Vertex* LLMs when `dict()` method is called. ``` >>> from langchain.chat_models.vertexai import ChatVertexAI >>> from langchain.llms.vertexai import VertexAI >>> chat_llm = ChatVertexAI() l>>> llm = VertexAI() >>> chat_llm.dict() {'_type': 'vertexai'} >>> llm.dict() {'_type': 'vertexai'} ``` This PR just uses the same mechanism used elsewhere to expose the full params. Since `_identifying_params()` is on the `_VertexAICommon` class, it should cover the chat and non-chat cases.
This commit is contained in:
parent
dc3ca44e05
commit
ba4e82bb47
@ -122,6 +122,11 @@ class _VertexAICommon(BaseModel):
|
||||
return enforce_stop_tokens(text, stop)
|
||||
return text
|
||||
|
||||
@property
|
||||
def _identifying_params(self) -> Dict[str, Any]:
|
||||
"""Get the identifying parameters."""
|
||||
return {**{"model_name": self.model_name}, **self._default_params}
|
||||
|
||||
@property
|
||||
def _llm_type(self) -> str:
|
||||
return "vertexai"
|
||||
|
Loading…
Reference in New Issue
Block a user