Skip to content

_identifying_params broken in ChatAnthropic class #10909

@thehunmonkgroup

Description

@thehunmonkgroup

System Info

v0.0.298

Who can help?

@hwchase17 @ago

Information

  • The official example notebooks/scripts
  • My own modified scripts

Related Components

  • LLMs/Chat Models
  • Embedding Models
  • Prompts / Prompt Templates / Prompt Selectors
  • Output Parsers
  • Document Loaders
  • Vector Stores / Retrievers
  • Memory
  • Agents / Agent Executors
  • Tools / Toolkits
  • Chains
  • Callbacks/Tracing
  • Async

Reproduction

Create a ChatAnthropic class instance, note that both _identifying_params and dict() do not output the proper attributes, even though _default_params does.

I'd make a PR to fix this, but upon examining the code, it's not clear to me what is causing the bug.

from langchain.chat_models import ChatAnthropic
chat = ChatAnthropic()
chat._default_params
{'max_tokens_to_sample': 256, 'model': 'claude-2'}
chat._identifying_params
{}
chat.dict()
{'_type': 'anthropic-chat'}

Expected behavior

_identifying_paramsand dict() should output the correct params.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugRelated to a bug, vulnerability, unexpected error with an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions