From c26deb6b388aceb07f435c4338cb2c5280007f92 Mon Sep 17 00:00:00 2001 From: dafu Date: Wed, 30 Aug 2023 09:49:42 +0800 Subject: [PATCH] fixed openai_functions api_response format args err root cause: args may not have a key (params) resulting in an error --- libs/langchain/langchain/chains/openai_functions/openapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/langchain/langchain/chains/openai_functions/openapi.py b/libs/langchain/langchain/chains/openai_functions/openapi.py index 100e4be28a6f7..a06d147ff6177 100644 --- a/libs/langchain/langchain/chains/openai_functions/openapi.py +++ b/libs/langchain/langchain/chains/openai_functions/openapi.py @@ -227,7 +227,7 @@ def _call( response = ( f"{api_response.status_code}: {api_response.reason}" + f"\nFor {name} " - + f"Called with args: {args['params']}" + + f"Called with args: {args.get('params','')}" ) else: try: