Skip to content

Commit

Permalink
core[patch]: Fix type for inner input in base prompts (#25713)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jamesev15 authored Aug 23, 2024
1 parent 5ce9a71 commit 080741d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/core/langchain_core/prompts/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def get_input_schema(
"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]
Expand Down

0 comments on commit 080741d

Please sign in to comment.