mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
fix: incorrect data type when construct_path in chain (#4031)
A incorrect data type error happened when executing _construct_path in `chain.py` as follows: ```python Error with message replace() argument 2 must be str, not int ``` The path is always a string. But the result of `args.pop(param, "")` is undefined.
This commit is contained in:
parent
349ba88aee
commit
c186f18aab
@ -61,7 +61,7 @@ class OpenAPIEndpointChain(Chain, BaseModel):
|
|||||||
"""Construct the path from the deserialized input."""
|
"""Construct the path from the deserialized input."""
|
||||||
path = self.api_operation.base_url + self.api_operation.path
|
path = self.api_operation.base_url + self.api_operation.path
|
||||||
for param in self.param_mapping.path_params:
|
for param in self.param_mapping.path_params:
|
||||||
path = path.replace(f"{{{param}}}", args.pop(param, ""))
|
path = path.replace(f"{{{param}}}", str(args.pop(param, "")))
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def _extract_query_params(self, args: Dict[str, str]) -> Dict[str, str]:
|
def _extract_query_params(self, args: Dict[str, str]) -> Dict[str, str]:
|
||||||
|
Loading…
Reference in New Issue
Block a user