Update browser_use/controller/service.py

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
Magnus Müller
2025-07-08 23:28:15 +02:00
committed by GitHub
parent 6f221ec504
commit 39208a3e19

View File

@@ -375,7 +375,7 @@ Only use this for specific queries for information retrieval from the page. Don'
# replace multiple sequential \n with a single \n
content = re.sub(r'\n+', '\n', content)
# limit to 000 characters - remove text in the middle this is approx 20000 tokens
# limit to 30000 characters - remove text in the middle (≈15000 tokens)
max_chars = 30000
if len(content) > max_chars:
logger.info(f'Content is too long, removing middle {len(content) - max_chars} characters')