Skip to content

Conversation

@ssh-esh
Copy link
Collaborator

@ssh-esh ssh-esh commented Dec 4, 2025

Part 2 of #93
Part of #78

  • make constructor accept client and creds
  • fix some mypy errors that popped up in the 2 commits before the last one (possibly from rotating our cache-key for poetry in another PR?)
  • add MKdocs compliant docs and examples for retriever class
  • update tests

@ssh-esh ssh-esh changed the title Standardize classes r Standardize ElasticsearchRetriever Dec 4, 2025
@ssh-esh ssh-esh marked this pull request as ready for review December 4, 2025 21:09
# Apply user agent
es_connection = with_user_agent_header(es_connection, "langchain-py-r")

# Pass ALL Pydantic fields to super().__init__() so Pydantic sets them
Copy link
Collaborator

@miguelgrinberg miguelgrinberg Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a reference to Pydantic here? I don't understand the significance of it. The parent class is a langchain class I think. I wasn't even aware there is Pydantic somewhere in the mix.

Copy link
Collaborator Author

@ssh-esh ssh-esh Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inheritance chain is something like below. I think the class level annotations with pydantic are used for runtime validation for this class

AsyncElasticsearchRetriever 
 - BaseRetriever (LangChain)
    - RunnableSerializable (LangChain)
      - Serializable (LangChain)
        - BaseModel (Pydantic)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am just going to remove the comment incase it is confusing

@ssh-esh ssh-esh merged commit f39da7d into langchain-ai:main Dec 8, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants