diff --git a/libs/vertexai/langchain_google_vertexai/_base.py b/libs/vertexai/langchain_google_vertexai/_base.py index e7ffc646..fe1793f3 100644 --- a/libs/vertexai/langchain_google_vertexai/_base.py +++ b/libs/vertexai/langchain_google_vertexai/_base.py @@ -118,7 +118,7 @@ def validate_params_base(cls, values: dict) -> Any: if values.get("client_cert_source"): client_options.client_cert_source = values["client_cert_source"] values["client_options"] = client_options - additional_headers = values.get("additional_headers", {}) + additional_headers = values.get("additional_headers") or {} values["default_metadata"] = tuple(additional_headers.items()) return values @@ -177,7 +177,7 @@ def _library_version(self) -> str: class _VertexAICommon(_VertexAIBase): client_preview: Any = Field(default=None, exclude=True) #: :meta private: - model_name: str = Field(default=None, alias="model") + model_name: Optional[str] = Field(default=None, alias="model") "Underlying model name." temperature: Optional[float] = None "Sampling temperature, it controls the degree of randomness in token selection." diff --git a/libs/vertexai/langchain_google_vertexai/chat_models.py b/libs/vertexai/langchain_google_vertexai/chat_models.py index 9f341a3b..2018bd06 100644 --- a/libs/vertexai/langchain_google_vertexai/chat_models.py +++ b/libs/vertexai/langchain_google_vertexai/chat_models.py @@ -877,7 +877,7 @@ class Joke(BaseModel): .. code-block:: python - 'The image is of five blueberry scones arranged on a piece of baking paper. \n\nHere is a list of what is in the picture:\n* **Five blueberry scones:** They are scattered across the parchment paper, dusted with powdered sugar. \n* **Two cups of coffee:** Two white cups with saucers. One appears full, the other partially drunk.\n* **A bowl of blueberries:** A brown bowl is filled with fresh blueberries, placed near the scones.\n* **A spoon:** A silver spoon with the words "Let\'s Jam" rests on the paper.\n* **Pink peonies:** Several pink peonies lie beside the scones, adding a touch of color.\n* **Baking paper:** The scones, cups, bowl, and spoon are arranged on a piece of white baking paper, splattered with purple. The paper is crinkled and sits on a dark surface. \n\nThe image has a rustic and delicious feel, suggesting a cozy and enjoyable breakfast or brunch setting. \n' + 'The image is of five blueberry scones arranged on a piece of baking paper. \n\nHere is a list of what is in the picture:\n* **Five blueberry scones:** They are scattered across the parchment paper, dusted with powdered sugar. \n* **Two cups of coffee:** Two white cups with saucers. One appears full, the other partially drunk.\n* **A bowl of blueberries:** A brown bowl is filled with fresh blueberries, placed near the scones.\n* **A spoon:** A silver spoon with the words "Let\'s Jam" rests on the paper.\n* **Pink peonies:** Several pink peonies lie beside the scones, adding a touch of color.\n* **Baking paper:** The scones, cups, bowl, and spoon are arranged on a piece of white baking paper, splattered with purple. The paper is crinkled and sits on a dark surface. \n\nThe image has a rustic and delicious feel, suggesting a cozy and enjoyable breakfast or brunch setting. \n' # codespell:ignore brunch Video input: **NOTE**: Currently only supported for ``gemini-...-vision`` models. diff --git a/libs/vertexai/langchain_google_vertexai/model_garden.py b/libs/vertexai/langchain_google_vertexai/model_garden.py index fd7938d6..8bd92ea2 100644 --- a/libs/vertexai/langchain_google_vertexai/model_garden.py +++ b/libs/vertexai/langchain_google_vertexai/model_garden.py @@ -139,8 +139,6 @@ async def _agenerate( class ChatAnthropicVertex(_VertexAICommon, BaseChatModel): async_client: Any = Field(default=None, exclude=True) #: :meta private: - model_name: Optional[str] = Field(default=None, alias="model") # type: ignore[assignment] - "Underlying model name." max_output_tokens: int = Field(default=1024, alias="max_tokens") access_token: Optional[str] = None stream_usage: bool = True # Whether to include usage metadata in streaming output