Huggingface.js 文档
类: HfAgent
加入 Hugging Face 社区
并获得增强的文档体验
开始使用
类: HfAgent
构造函数
constructor
• new HfAgent(accessToken?, LLM?, tools?): HfAgent
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
accessToken | string | "" |
LLM? | LLM | undefined |
tools? | Tool[] | undefined |
返回值
定义于
属性
accessToken
• Private accessToken: string
定义于
llm
• Private llm: LLM
定义于
tools
• Private tools: Tool[]
定义于
方法
evaluateCode
▸ evaluateCode(code, files?): Promise\<Update[]>
参数
| 名称 | 类型 |
|---|---|
code | string |
files? | FileList |
返回值
Promise\<Update[]>
定义于
generateCode
▸ generateCode(prompt, files?): Promise\<string>
参数
| 名称 | 类型 |
|---|---|
prompt | string |
files? | FileList |
返回值
Promise\<string>
定义于
generatePrompt
▸ generatePrompt(prompt, files?): string
参数
| 名称 | 类型 |
|---|---|
prompt | string |
files? | FileList |
返回值
string
定义于
run
▸ run(prompt, files?): Promise\<Update[]>
参数
| 名称 | 类型 |
|---|---|
prompt | string |
files? | FileList |
返回值
Promise\<Update[]>