INNER CODE UNIT · TypeScript
examineDom
hyperbrowserai/HyperAgent · src/agent/examine-dom/index.ts:40
export async function examineDom(
instruction: string,
context: ExamineDomContext,
llm: HyperAgentLLM
): Promise<{
elements: ExamineDomResultsType["elements"];
llmResponse: { rawText: string; parsed: unknown };
}> {
// Build prompts for element finding
const systemPrompt = buildExamineDomSystemPrompt();
const userPrompt = buildExamineDomUserPrompt(instruction, context.tree);
try {
// Call LLM with structured output to find elements
const response = await llm.invokeStructured(
{
schema: ExamineDomResultsSchema,
options: {