mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-29 09:58:44 +00:00
Exclude Bedrock client and credentials_profile_name fields from serialisation (#13603)
This commit is contained in:
parent
48fbc5513d
commit
947daaf833
@ -54,8 +54,6 @@ class BedrockChat(BaseChatModel, BedrockBase):
|
||||
def lc_attributes(self) -> Dict[str, Any]:
|
||||
attributes: Dict[str, Any] = {}
|
||||
|
||||
print(self.region_name)
|
||||
|
||||
if self.region_name:
|
||||
attributes["region_name"] = self.region_name
|
||||
|
||||
|
@ -4,7 +4,7 @@ from abc import ABC
|
||||
from typing import Any, Dict, Iterator, List, Mapping, Optional
|
||||
|
||||
from langchain_core.outputs import GenerationChunk
|
||||
from langchain_core.pydantic_v1 import BaseModel, Extra, root_validator
|
||||
from langchain_core.pydantic_v1 import BaseModel, Extra, Field, root_validator
|
||||
|
||||
from langchain.callbacks.manager import CallbackManagerForLLMRun
|
||||
from langchain.llms.base import LLM
|
||||
@ -148,14 +148,14 @@ class LLMInputOutputAdapter:
|
||||
class BedrockBase(BaseModel, ABC):
|
||||
"""Base class for Bedrock models."""
|
||||
|
||||
client: Any #: :meta private:
|
||||
client: Any = Field(exclude=True) #: :meta private:
|
||||
|
||||
region_name: Optional[str] = None
|
||||
"""The aws region e.g., `us-west-2`. Fallsback to AWS_DEFAULT_REGION env variable
|
||||
or region specified in ~/.aws/config in case it is not provided here.
|
||||
"""
|
||||
|
||||
credentials_profile_name: Optional[str] = None
|
||||
credentials_profile_name: Optional[str] = Field(default=None, exclude=True)
|
||||
"""The name of the profile in the ~/.aws/credentials or ~/.aws/config files, which
|
||||
has either access keys or role information specified.
|
||||
If not specified, the default credential profile or, if on an EC2 instance,
|
||||
|
Loading…
Reference in New Issue
Block a user