browser-use-typescript
Version:
A TypeScript-based browser automation framework
46 lines (43 loc) • 1.44 kB
TypeScript
import { SystemMessage, HumanMessage } from "@langchain/core/messages";
import { ActionResult, AgentStepInfo } from "./types";
import { BrowserState } from "../browser/playwrightBrowser/type";
/**
* Defines the system prompt for the browser automation agent
*/
export declare class SystemPrompt {
defaultActionDescription: string;
maxActionsPerStep: number;
promptTemplate: string;
systemMessage: SystemMessage;
constructor(actionDescription: string, maxActionsPerStep?: number, overrideSystemMessage?: string, extendSystemMessage?: string);
/**
* Load the prompt template from the markdown file
*/
private loadPromptTemplate;
/**
* Get the system message for the agent
*/
getSystemMessage(): SystemMessage;
}
/**
* Interface for agent step information
/**
* Formats messages for the agent from browser state
*/
export declare class AgentMessagePrompt {
state: BrowserState;
result?: ActionResult[];
includeAttributes: string[];
stepInfo?: AgentStepInfo;
constructor(state: BrowserState, result?: ActionResult[], includeAttributes?: string[], stepInfo?: AgentStepInfo);
/**
* Get a formatted user message containing browser state
*/
getUserMessage(useVision?: boolean): HumanMessage;
}
/**
* Specialized system prompt for planning agent
*/
export declare class PlannerPrompt extends SystemPrompt {
getSystemMessage(): SystemMessage;
}