Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude Bedrock client and credentials_profile_name fields from serialisation #13603

Merged
merged 2 commits into from
Nov 28, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Exclude Bedrock client and credentials_profile_name fields from seria…
…lisation
  • Loading branch information
dqbd committed Nov 22, 2023
commit a389bd8bb0276764f25d6eda61a93508b2561531
6 changes: 3 additions & 3 deletions libs/langchain/langchain/llms/bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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
Expand Down Expand Up @@ -148,14 +148,14 @@ def prepare_output_stream(
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,
Expand Down