From 46f0cea2b9b45a76e610c9782c369b2ea8772adb Mon Sep 17 00:00:00 2001 From: al1p Date: Sat, 9 Mar 2024 02:53:09 +0200 Subject: [PATCH] community[patch][: improved the suffix prompt to avoid loop (#17791) Small improvement to the openapi prompt. The agent was not finding the server base URL (looping through all nodes). This small change narrows the search and enables finding the url faster. No dependency Twitter : @al1pra --- .../langchain_community/agent_toolkits/openapi/prompt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/community/langchain_community/agent_toolkits/openapi/prompt.py b/libs/community/langchain_community/agent_toolkits/openapi/prompt.py index 0484f5bf5d9..2b4f90f55c5 100644 --- a/libs/community/langchain_community/agent_toolkits/openapi/prompt.py +++ b/libs/community/langchain_community/agent_toolkits/openapi/prompt.py @@ -19,7 +19,7 @@ If you get a not found error, ensure that you are using a path that actually exi OPENAPI_SUFFIX = """Begin! Question: {input} -Thought: I should explore the spec to find the base url for the API. +Thought: I should explore the spec to find the base server url for the API in the servers node. {agent_scratchpad}""" DESCRIPTION = """Can be used to answer questions about the openapi spec for the API. Always use this tool before trying to make a request.