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.
pull/21438/head
Tommi Holmgren 4 weeks ago committed by GitHub
parent 710e57d779
commit ee35b9ba56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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

Loading…
Cancel
Save