You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
? `Extract the following information from the page according to this objective: "${objective}"\n\nPage content:\n${trimmedMarkdown}\nHere is a screenshot of the page:\n`
129
+
: `Extract the following information from the page according to this objective: "${objective}"\n\nPage content:\n${trimmedMarkdown}\nNo screenshot was available. Use the page content to extract the answer.`;
130
+
constcontentParts: HyperAgentContentPart[]=[
131
+
{
132
+
type: "text",
133
+
text: textPrompt,
134
+
},
135
+
];
136
+
if(screenshotData){
137
+
contentParts.push({
138
+
type: "image",
139
+
url: `data:image/png;base64,${screenshotData}`,
140
+
mimeType: "image/png",
141
+
});
142
+
}
143
+
59
144
constresponse=awaitctx.llm.invoke([
60
145
{
61
146
role: "user",
62
-
content: [
63
-
{
64
-
type: "text",
65
-
text: `Extract the following information from the page according to this objective: "${objective}"\n\nPage content:\n${trimmedMarkdown}\nHere is a screenshot of the page:\n`,
66
-
},
67
-
{
68
-
type: "image",
69
-
url: `data:image/png;base64,${screenshot.data}`,
70
-
mimeType: "image/png",
71
-
},
72
-
],
147
+
content: contentParts,
73
148
},
74
149
]);
75
150
// Handle both string and HyperAgentContentPart[] responses
0 commit comments