Huggingface.js documentation

Class: HfAgent

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Class: HfAgent

Constructors

constructor

new HfAgent(accessToken?, LLM?, tools?): HfAgent

Parameters

Name Type Default value
accessToken string ""
LLM? LLM undefined
tools? Tool[] undefined

Returns

HfAgent

Defined in

HfAgent.ts:14

Properties

accessToken

Private accessToken: string

Defined in

HfAgent.ts:10


llm

Private llm: LLM

Defined in

HfAgent.ts:11


tools

Private tools: Tool[]

Defined in

HfAgent.ts:12

Methods

evaluateCode

evaluateCode(code, files?): Promise\<Update[]>

Parameters

Name Type
code string
files? FileList

Returns

Promise\<Update[]>

Defined in

HfAgent.ts:31


generateCode

generateCode(prompt, files?): Promise\<string>

Parameters

Name Type
prompt string
files? FileList

Returns

Promise\<string>

Defined in

HfAgent.ts:27


generatePrompt

generatePrompt(prompt, files?): string

Parameters

Name Type
prompt string
files? FileList

Returns

string

Defined in

HfAgent.ts:20


run

run(prompt, files?): Promise\<Update[]>

Parameters

Name Type
prompt string
files? FileList

Returns

Promise\<Update[]>

Defined in

HfAgent.ts:51

< > Update on GitHub