Skip to content

The agent engineering platform.

fix: incorrect data type when construct_path in chain (#4031)

Zeelandc186f18aaba6
diff --git a/langchain/chains/api/openapi/chain.py b/langchain/chains/api/openapi/chain.py
index 57e9ee5f99..039770f779 100644
--- a/langchain/chains/api/openapi/chain.py
+++ b/langchain/chains/api/openapi/chain.py
@@ -61,7 +61,7 @@ class OpenAPIEndpointChain(Chain, BaseModel):
"""Construct the path from the deserialized input."""
path = self.api_operation.base_url + self.api_operation.path
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
def _extract_query_params(self, args: Dict[str, str]) -> Dict[str, str]: