core[patch]: Fix type for inner input in base prompts (#25713)

Thank you for contributing to LangChain!

- [ ] **PR title**: "langchain-core: Fix type"
- The file to modify is located in
/libs/core/langchain_core/prompts/base.py


- [ ] **PR message**: 
- **Description:** The change is a type for the inner input variable,
the type go from dict to Any. This change is required since the method
_validate input expects a type that is not only a dictionary.
    - **Dependencies:** There are no dependencies for this change


- [ ] **Add tests and docs**: 
1. A test is not needed. This error occurs because I overrode a portion
of the _validate_input method, which is causing a 'beartype' to raise an
error.
This commit is contained in:
James Espichan Vilca 2024-08-23 16:06:39 -05:00 committed by GitHub
parent 5ce9a716a7
commit 080741d336
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -129,7 +129,7 @@ class BasePromptTemplate(
"PromptInput", **{**required_input_variables, **optional_input_variables}
)
def _validate_input(self, inner_input: Dict) -> Dict:
def _validate_input(self, inner_input: Any) -> Dict:
if not isinstance(inner_input, dict):
if len(self.input_variables) == 1:
var_name = self.input_variables[0]