Class: Nolita
High level wrapper for the Nolita API.
Constructors
new Nolita()
new Nolita(
hdrApiKey
:string
,providerApiKey
:string
,opts
?: {endpoint
:string
;model
:string
;provider
:string
;systemPrompt
:string
;temperature
:number
; }):Nolita
Initializes a new instance of the Nolita class.
Parameters
Parameter | Type | Description |
---|---|---|
hdrApiKey | string | The HDR api key. |
providerApiKey | string | The collective memory endpoint. Defaults to "https://api.hdr.is". |
opts ? | object | Optional configuration options |
opts.endpoint ? | string | The collective memory endpoint. Defaults to "https://api.hdr.is". |
opts.model ? | string | The model to use. Defaults to "gpt-4". |
opts.provider ? | string | The provider to use. Defaults to "openai". |
opts.systemPrompt ? | string | The system prompt to use. |
opts.temperature ? | number | The temperature to use. Defaults to 0 |
Returns
Defined in
Properties
agent
agent:
Agent
The agent instance that interacts with the browser. Defaults to OpenAI's gpt-4
Defined in
hdrApiKey
hdrApiKey:
string
The HDR api key.
Defined in
hdrEndpoint
hdrEndpoint:
string
="https://api.hdr.is"
The collective memory endpoint. Defaults to "https://api.hdr.is".
Defined in
Methods
task()
task(
task
: {objective
:string
;returnSchema
:ZodObject
<any
,UnknownKeysParam
,ZodTypeAny
, {}, {}>;startUrl
:string
; },opts
?: {headless
:boolean
;inventory
:Inventory
;maxTurns
:number
; }):Promise
<{command
: ({index
:number
;kind
:"Click"
; } | {index
:number
;kind
:"Type"
;text
:string
; } | {kind
:"Back"
; } | {kind
:"Wait"
; })[];description
:string
;objectiveComplete
:updatedObjectiveComplete
;progressAssessment
:string
; } | {objectiveFailed
: {kind
:"ObjectiveFailed"
;result
:failureReason
;url
:string
; }; }>
Executes a task using the Nolita API.
Parameters
Parameter | Type | Description |
---|---|---|
task | object | string "Tell me the email addresses on the contact page" |
task.objective | string | string The objective of the task "Tell me the email addresses on the contact page" |
task.returnSchema ? | ZodObject <any , UnknownKeysParam , ZodTypeAny , {}, {}> | z.ZodObject |
task.startUrl ? | string | string The URL the taks will begin at "https://hdr.is" |
opts ? | object | |
opts.headless ? | boolean | boolean Whether to run the browser in headless mode. Defaults to false |
opts.inventory ? | Inventory | Inventory The inventory to use when doing tasks |
opts.maxTurns ? | number | number The maximum number of turns to allow. Defaults to 10 |
Returns
Promise
<{command
: ({index
: number
;kind
: "Click"
; } | {index
: number
;kind
: "Type"
;text
: string
; } | {kind
: "Back"
; } | {kind
: "Wait"
; })[];description
: string
;objectiveComplete
: updatedObjectiveComplete
;progressAssessment
: string
; } | {objectiveFailed
: {kind
: "ObjectiveFailed"
;result
: failureReason
;url
: string
; }; }>