mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Render screenshot in train of thought on openai agent screenshot action
This commit is contained in:
@@ -352,7 +352,7 @@ export function TrainOfThought(props: TrainOfThoughtProps) {
|
||||
// Render screenshot image in screenshot action message
|
||||
let screenshotData = null;
|
||||
try {
|
||||
const jsonMatch = message.match(/\{"action": "screenshot".*\}/);
|
||||
const jsonMatch = message.match(/\{.*("action": "screenshot"|"type": "screenshot").*\}/);
|
||||
if (jsonMatch) {
|
||||
screenshotData = JSON.parse(jsonMatch[0]);
|
||||
const screenshotHtmlString = `<img src="${screenshotData.image}" alt="State of browser" class="max-w-full" />`;
|
||||
|
||||
Reference in New Issue
Block a user