From ee35b9ba562ce2779249035432cf0ff8c137ef63 Mon Sep 17 00:00:00 2001 From: Tommi Holmgren Date: Wed, 8 May 2024 22:05:55 +0300 Subject: [PATCH] langchain-robocorp: remove toolkit return content max length (#21436) Robocorp (action server) toolkit had a limitation that the content length returned by the tool was always cut to max 5000 chars. This was from the time when context windows were much more limited. This PR removes the limitation. Whatever the underlying tool provides gets sent back to the agent. As the robocorp toolkit no longer restricts the content, the implication is that either the Action (tool) developer or the agent developer needs to be aware of potentially oversized tool responses. Our point of view is this should be the agent developer's responsibility, them being in control of the use case and aware of the context window the LLM has. --- libs/partners/robocorp/langchain_robocorp/toolkits.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/partners/robocorp/langchain_robocorp/toolkits.py b/libs/partners/robocorp/langchain_robocorp/toolkits.py index 335b4d44fc1..fc21cf0959e 100644 --- a/libs/partners/robocorp/langchain_robocorp/toolkits.py +++ b/libs/partners/robocorp/langchain_robocorp/toolkits.py @@ -27,7 +27,6 @@ from langchain_robocorp._prompts import ( API_CONTROLLER_PROMPT, ) -MAX_RESPONSE_LENGTH = 5000 LLM_TRACE_HEADER = "X-action-trace" @@ -241,6 +240,5 @@ class ActionServerToolkit(BaseModel): url = urljoin(self.url, endpoint) response = requests.post(url, headers=headers, data=json.dumps(data)) - output = response.text[:MAX_RESPONSE_LENGTH] - return output + return response.text