mirror of https://github.com/kortix-ai/suna.git
Merge pull request #771 from tnfssc/fix/token-compression-browser
This commit is contained in:
commit
27daa2b150
|
@ -68,10 +68,12 @@ class ThreadManager:
|
||||||
content = msg['content']
|
content = msg['content']
|
||||||
if isinstance(content, str) and "ToolResult" in content: return True
|
if isinstance(content, str) and "ToolResult" in content: return True
|
||||||
if isinstance(content, dict) and "tool_execution" in content: return True
|
if isinstance(content, dict) and "tool_execution" in content: return True
|
||||||
|
if isinstance(content, dict) and "interactive_elements" in content: return True
|
||||||
if isinstance(content, str):
|
if isinstance(content, str):
|
||||||
try:
|
try:
|
||||||
parsed_content = json.loads(content)
|
parsed_content = json.loads(content)
|
||||||
if isinstance(parsed_content, dict) and "tool_execution" in parsed_content: return True
|
if isinstance(parsed_content, dict) and "tool_execution" in parsed_content: return True
|
||||||
|
if isinstance(parsed_content, dict) and "interactive_elements" in content: return True
|
||||||
except (json.JSONDecodeError, TypeError):
|
except (json.JSONDecodeError, TypeError):
|
||||||
pass
|
pass
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue