mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-04-28 11:40:47 +00:00
browser_agent improvements, prompts adjustments
This commit is contained in:
parent
aadc111b31
commit
a6f236f7fa
10 changed files with 120 additions and 46 deletions
|
|
@ -2,7 +2,11 @@ import re
|
|||
import sys
|
||||
import time
|
||||
|
||||
from python.helpers import files
|
||||
def sanitize_string(s: str, encoding: str = "utf-8") -> str:
|
||||
# Replace surrogates and invalid unicode with replacement character
|
||||
if not isinstance(s, str):
|
||||
s = str(s)
|
||||
return s.encode(encoding, 'replace').decode(encoding, 'replace')
|
||||
|
||||
def calculate_valid_match_lengths(first: bytes | str, second: bytes | str,
|
||||
deviation_threshold: int = 5,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue