Class: AgentBrowser
Constructors
new AgentBrowser()
new AgentBrowser(
agentBrowserArgs: {agent:Agent;behaviorConfig: {actionDelay:number;goToDelay:number;telemetry:boolean; };browser:Browser;collectiveMemoryConfig: {apiKey:string;endpoint:string; };inventory:Inventory;logger:Logger; }):AgentBrowser
Parameters
| Parameter | Type |
|---|---|
agentBrowserArgs | object |
agentBrowserArgs.agent | Agent |
agentBrowserArgs.behaviorConfig? | object |
agentBrowserArgs.behaviorConfig.actionDelay | number |
agentBrowserArgs.behaviorConfig.goToDelay | number |
agentBrowserArgs.behaviorConfig.telemetry | boolean |
agentBrowserArgs.browser | Browser |
agentBrowserArgs.collectiveMemoryConfig? | object |
agentBrowserArgs.collectiveMemoryConfig.apiKey | string |
agentBrowserArgs.collectiveMemoryConfig.endpoint | string |
agentBrowserArgs.inventory? | Inventory |
agentBrowserArgs.logger? | Logger |
Returns
Defined in
Properties
agent
agent:
Agent
Defined in
browser
browser:
Browser
Defined in
config
config: {
actionDelay:number;goToDelay:number;telemetry:boolean; }
actionDelay
actionDelay:
number
goToDelay
goToDelay:
number
telemetry
telemetry:
boolean
Defined in
hdrConfig
hdrConfig: {
apiKey:string;endpoint:string; }
apiKey
apiKey:
string
endpoint
endpoint:
string
Defined in
inventory?
optionalinventory:Inventory
Defined in
logger
logger:
Logger
Defined in
page
page:
undefined|Page
Defined in
Methods
browse()
browse<
TObjectiveComplete>(browserObjective: {maxIterations:number;objective:string[];startUrl:string; },responseType:ZodObject<{command:ZodOptional<ZodType<any,ZodTypeDef,any>>;description:ZodString;objectiveComplete:ZodOptional<ZodObject<{kind:ZodLiteral<"ObjectiveComplete">;result:ZodString; },"strip",ZodTypeAny, {kind:"ObjectiveComplete";result:string; }, {kind:"ObjectiveComplete";result:string; }>> |ZodOptional<ZodObject<extendShape<{kind:ZodLiteral<"ObjectiveComplete">;result:ZodString; },TObjectiveComplete["shape"]>,TObjectiveComplete["_def"]["unknownKeys"],TObjectiveComplete["_def"]["catchall"],objectOutputType<extendShape<{kind:ZodLiteral<"ObjectiveComplete">;result:ZodString; },TObjectiveComplete["shape"]>,TObjectiveComplete["_def"]["catchall"],TObjectiveComplete["_def"]["unknownKeys"]>,objectInputType<extendShape<{kind:ZodLiteral<"ObjectiveComplete">;result:ZodString; },TObjectiveComplete["shape"]>,TObjectiveComplete["_def"]["catchall"],TObjectiveComplete["_def"]["unknownKeys"]>>>;progressAssessment:ZodString; },"strip",ZodTypeAny, { [k in "description" | "progressAssessment" | "command" | "objectiveComplete"]: addQuestionMarks<baseObjectOutputType<Object>, any>[k] }, { [k_1 in "description" | "progressAssessment" | "command" | "objectiveComplete"]: baseObjectInputType<Object>[k_1] }>):Promise<undefined| {content:Promise<string>;result: {kind:"ObjectiveFailed";result:failureReason; };url:string; } | {content:string;kind:"ObjectiveComplete";result:stepResponse;url:string; }>
Type Parameters
| Type Parameter | Default type |
|---|---|
TObjectiveComplete extends AnyZodObject | ZodObject<{kind: ZodLiteral<"ObjectiveComplete">;result: ZodString; }, "strip", ZodTypeAny, {kind: "ObjectiveComplete";result: string; }, {kind: "ObjectiveComplete";result: string; }> |
Parameters
| Parameter | Type |
|---|---|
browserObjective | object |
browserObjective.maxIterations | number |
browserObjective.objective | string[] |
browserObjective.startUrl | string |
responseType | ZodObject<{command: ZodOptional<ZodType<any, ZodTypeDef, any>>;description: ZodString;objectiveComplete: ZodOptional<ZodObject<{kind: ZodLiteral<"ObjectiveComplete">;result: ZodString; }, "strip", ZodTypeAny, {kind: "ObjectiveComplete";result: string; }, {kind: "ObjectiveComplete";result: string; }>> | ZodOptional<ZodObject<extendShape<{kind: ZodLiteral<"ObjectiveComplete">;result: ZodString; }, TObjectiveComplete["shape"]>, TObjectiveComplete["_def"]["unknownKeys"], TObjectiveComplete["_def"]["catchall"], objectOutputType<extendShape<{kind: ZodLiteral<"ObjectiveComplete">;result: ZodString; }, TObjectiveComplete["shape"]>, TObjectiveComplete["_def"]["catchall"], TObjectiveComplete["_def"]["unknownKeys"]>, objectInputType<extendShape<{kind: ZodLiteral<"ObjectiveComplete">;result: ZodString; }, TObjectiveComplete["shape"]>, TObjectiveComplete["_def"]["catchall"], TObjectiveComplete["_def"]["unknownKeys"]>>>;progressAssessment: ZodString; }, "strip", ZodTypeAny, { [k in "description" | "progressAssessment" | "command" | "objectiveComplete"]: addQuestionMarks<baseObjectOutputType<Object>, any>[k] }, { [k_1 in "description" | "progressAssessment" | "command" | "objectiveComplete"]: baseObjectInputType<Object>[k_1] }> |
Returns
Promise<undefined | {content: Promise<string>;result: {kind: "ObjectiveFailed";result: failureReason; };url: string; } | {content: string;kind: "ObjectiveComplete";result: stepResponse;url: string; }>
Defined in
close()
close():
Promise<void>
Returns
Promise<void>
Defined in
followPath()
followPath<
TObjectiveComplete>(memorySequenceId:string,page:Page,browserObjective: {maxIterations:number;objective:string[];startUrl:string; },responseSchema:ZodObject<{description:ZodString;objectiveComplete:ZodObject<{kind:ZodLiteral<"ObjectiveComplete">;result:ZodString; },"strip",ZodTypeAny, {kind:"ObjectiveComplete";result:string; }, {kind:"ObjectiveComplete";result:string; }> |TObjectiveComplete;progressAssessment:ZodString; },"strip",ZodTypeAny, { [k in "description" | "progressAssessment" | "objectiveComplete"]: addQuestionMarks<baseObjectOutputType<Object>, any>[k] }, { [k_1 in "description" | "progressAssessment" | "objectiveComplete"]: baseObjectInputType<Object>[k_1] }>):Promise<undefined| {content:string;kind:"ObjectiveComplete";result:stepResponse;url:string; }>
Type Parameters
| Type Parameter | Default type |
|---|---|
TObjectiveComplete extends AnyZodObject | ZodObject<{kind: ZodLiteral<"ObjectiveComplete">;result: ZodString; }, "strip", ZodTypeAny, {kind: "ObjectiveComplete";result: string; }, {kind: "ObjectiveComplete";result: string; }> |
Parameters
| Parameter | Type |
|---|---|
memorySequenceId | string |
page | Page |
browserObjective | object |
browserObjective.maxIterations | number |
browserObjective.objective | string[] |
browserObjective.startUrl | string |
responseSchema | ZodObject<{description: ZodString;objectiveComplete: ZodObject<{kind: ZodLiteral<"ObjectiveComplete">;result: ZodString; }, "strip", ZodTypeAny, {kind: "ObjectiveComplete";result: string; }, {kind: "ObjectiveComplete";result: string; }> | TObjectiveComplete;progressAssessment: ZodString; }, "strip", ZodTypeAny, { [k in "description" | "progressAssessment" | "objectiveComplete"]: addQuestionMarks<baseObjectOutputType<Object>, any>[k] }, { [k_1 in "description" | "progressAssessment" | "objectiveComplete"]: baseObjectInputType<Object>[k_1] }> |
Returns
Promise<undefined | {content: string;kind: "ObjectiveComplete";result: stepResponse;url: string; }>
Defined in
followRoute()
followRoute(
page:Page,memories: {actionStep: {command:any;description:string;objectiveComplete: {kind:"ObjectiveComplete";result:string; } | {};progressAssessment:string; };objectiveState:ObjectiveState; }[]):Promise<void>
Parameters
| Parameter | Type |
|---|---|
page | Page |
memories | {actionStep: {command: any;description: string;objectiveComplete: {kind: "ObjectiveComplete";result: string; } | {};progressAssessment: string; };objectiveState: ObjectiveState; }[] |
Returns
Promise<void>
Defined in
memorize()
memorize(
state: {ariaTree:string;kind:"ObjectiveState";objective:string;progress:string[];url:string; },action:ModelResponseType):Promise<void>
Parameters
| Parameter | Type |
|---|---|
state | object |
state.ariaTree | string |
state.kind | "ObjectiveState" |
state.objective | string |
state.progress | string[] |
state.url | string |
action | ModelResponseType |
Returns
Promise<void>
Defined in
performMemory()
performMemory(
page:Page,memory: {actionStep: {command:any;description:string;objectiveComplete: {kind:"ObjectiveComplete";result:string; } | {};progressAssessment:string; };objectiveState:ObjectiveState; }):Promise<undefined| {content:Promise<string>;result: {kind:"ObjectiveFailed";result:failureReason; };url:string; }>
Parameters
| Parameter | Type |
|---|---|
page | Page |
memory | object |
memory.actionStep | object |
memory.actionStep.command? | any |
memory.actionStep.description | string |
memory.actionStep.objectiveComplete? | {kind: "ObjectiveComplete";result: string; } | {} |
memory.actionStep.progressAssessment | string |
memory.objectiveState | object |
memory.objectiveState.ariaTree | string |
memory.objectiveState.kind | "ObjectiveState" |
memory.objectiveState.objective | string |
memory.objectiveState.progress | string[] |
memory.objectiveState.url | string |
Returns
Promise<undefined | {content: Promise<string>;result: {kind: "ObjectiveFailed";result: failureReason; };url: string; }>
Defined in
remember()
remember(
state: {ariaTree:string;kind:"ObjectiveState";objective:string;progress:string[];url:string; }):Promise<{actionStep: {command:any;description:string;objectiveComplete: {kind:"ObjectiveComplete";result:string; } | {};progressAssessment:string; };objectiveState:ObjectiveState; }[]>
Parameters
| Parameter | Type |
|---|---|
state | object |
state.ariaTree | string |
state.kind | "ObjectiveState" |
state.objective | string |
state.progress | string[] |
state.url | string |
Returns
Promise<{actionStep: {command: any;description: string;objectiveComplete: {kind: "ObjectiveComplete";result: string; } | {};progressAssessment: string; };objectiveState: ObjectiveState; }[]>
Defined in
reset()
reset():
void
Returns
void
Defined in
returnErrorState()
returnErrorState(
page:Page,failureReason:string):Promise<{content:Promise<string>;result: {kind:"ObjectiveFailed";result:failureReason; };url:string; }>
Parameters
| Parameter | Type |
|---|---|
page | Page |
failureReason | string |
Returns
Promise<{content: Promise<string>;result: {kind: "ObjectiveFailed";result: failureReason; };url: string; }>
content
content:
Promise<string>
result
result: {
kind:"ObjectiveFailed";result:failureReason; }
result.kind
kind:
string="ObjectiveFailed"
result.result
result:
string=failureReason
url
url:
string
Defined in
step()
step<
TObjectiveComplete>(page:Page,currentObjective:string,responseType:ZodObject<{command:ZodOptional<ZodType<any,ZodTypeDef,any>>;description:ZodString;objectiveComplete:ZodOptional<ZodObject<{kind:ZodLiteral<"ObjectiveComplete">;result:ZodString; },"strip",ZodTypeAny, {kind:"ObjectiveComplete";result:string; }, {kind:"ObjectiveComplete";result:string; }>> |ZodOptional<ZodObject<extendShape<{kind:ZodLiteral<"ObjectiveComplete">;result:ZodString; },TObjectiveComplete["shape"]>,TObjectiveComplete["_def"]["unknownKeys"],TObjectiveComplete["_def"]["catchall"],objectOutputType<extendShape<{kind:ZodLiteral<"ObjectiveComplete">;result:ZodString; },TObjectiveComplete["shape"]>,TObjectiveComplete["_def"]["catchall"],TObjectiveComplete["_def"]["unknownKeys"]>,objectInputType<extendShape<{kind:ZodLiteral<"ObjectiveComplete">;result:ZodString; },TObjectiveComplete["shape"]>,TObjectiveComplete["_def"]["catchall"],TObjectiveComplete["_def"]["unknownKeys"]>>>;progressAssessment:ZodString; },"strip",ZodTypeAny, { [k in "description" | "progressAssessment" | "command" | "objectiveComplete"]: addQuestionMarks<baseObjectOutputType<Object>, any>[k] }, { [k_1 in "description" | "progressAssessment" | "command" | "objectiveComplete"]: baseObjectInputType<Object>[k_1] }>):Promise<any>
Type Parameters
| Type Parameter | Default type |
|---|---|
TObjectiveComplete extends AnyZodObject | ZodObject<{kind: ZodLiteral<"ObjectiveComplete">;result: ZodString; }, "strip", ZodTypeAny, {kind: "ObjectiveComplete";result: string; }, {kind: "ObjectiveComplete";result: string; }> |
Parameters
| Parameter | Type |
|---|---|
page | Page |
currentObjective | string |
responseType | ZodObject<{command: ZodOptional<ZodType<any, ZodTypeDef, any>>;description: ZodString;objectiveComplete: ZodOptional<ZodObject<{kind: ZodLiteral<"ObjectiveComplete">;result: ZodString; }, "strip", ZodTypeAny, {kind: "ObjectiveComplete";result: string; }, {kind: "ObjectiveComplete";result: string; }>> | ZodOptional<ZodObject<extendShape<{kind: ZodLiteral<"ObjectiveComplete">;result: ZodString; }, TObjectiveComplete["shape"]>, TObjectiveComplete["_def"]["unknownKeys"], TObjectiveComplete["_def"]["catchall"], objectOutputType<extendShape<{kind: ZodLiteral<"ObjectiveComplete">;result: ZodString; }, TObjectiveComplete["shape"]>, TObjectiveComplete["_def"]["catchall"], TObjectiveComplete["_def"]["unknownKeys"]>, objectInputType<extendShape<{kind: ZodLiteral<"ObjectiveComplete">;result: ZodString; }, TObjectiveComplete["shape"]>, TObjectiveComplete["_def"]["catchall"], TObjectiveComplete["_def"]["unknownKeys"]>>>;progressAssessment: ZodString; }, "strip", ZodTypeAny, { [k in "description" | "progressAssessment" | "command" | "objectiveComplete"]: addQuestionMarks<baseObjectOutputType<Object>, any>[k] }, { [k_1 in "description" | "progressAssessment" | "command" | "objectiveComplete"]: baseObjectInputType<Object>[k_1] }> |
Returns
Promise<any>