fix frontend browsing screenshot, allow link following in MD (#1817)

This commit is contained in:
Frank Xu 2024-05-16 06:06:06 -04:00 committed by GitHub
parent 52e21c20e3
commit adea9b3f32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 6 deletions

View File

@ -17,8 +17,8 @@ export function handleObservationMessage(message: ObservationMessage) {
store.dispatch(appendJupyterOutput(message.content));
break;
case ObservationType.BROWSE:
if (message.screenshot) {
store.dispatch(setScreenshotSrc(message.screenshot));
if (message.extras?.screenshot) {
store.dispatch(setScreenshotSrc(message.extras?.screenshot));
}
if (message.extras?.url) {
store.dispatch(setUrl(message.extras.url));

View File

@ -21,7 +21,4 @@ export interface ObservationMessage {
// A friendly message that can be put in the chat log
message: string;
// optional screenshot
screenshot?: string;
}

View File

@ -23,7 +23,7 @@ class BrowserEnv:
def __init__(self):
self.html_text_converter = html2text.HTML2Text()
# ignore links and images
self.html_text_converter.ignore_links = True
self.html_text_converter.ignore_links = False
self.html_text_converter.ignore_images = True
# use alt text for images
self.html_text_converter.images_to_alt = True