hands test 2
This commit is contained in:
@@ -115,7 +115,7 @@ func browserTool(_ args: [String: Any]) async throws -> [Content] {
|
||||
throw ToolError("unknown op \(op.debugDescription)")
|
||||
}
|
||||
let present: (String) async throws -> Bool = { needle in
|
||||
(try? js("String(!!document.body && document.body.innerText.includes(\(jsString(needle))))", target)) == "true"
|
||||
(try? js("String((document.title + '\\n' + (document.body ? document.body.innerText : '')).toLowerCase().includes(\(jsString(needle.lowercased()))))", target)) == "true"
|
||||
}
|
||||
if let note = try await waitFor(args, acted: false, present) {
|
||||
log.append(note)
|
||||
|
||||
Reference in New Issue
Block a user