Huggingface.js documentation
接口:选项
@huggingface/inference
使用 Inference ClientAPI 参考
类
HfInferenceInferenceClientInferenceClientEndpointInferenceClientErrorInferenceClientHubApiErrorInferenceClientInputErrorInferenceClientProviderApiErrorInferenceClientProviderOutputErrorInferenceClientRoutingError
接口
AudioToAudioOutputAudioToAudioOutputElemBaseArgsBodyParamsHeaderParamsInferenceProviderMappingEntryLogger选项TextGenerationInputTextGenerationOutputTextGenerationStreamBestOfSequenceTextGenerationStreamDetailsTextGenerationStreamOutputTextGenerationStreamPrefillTokenTextGenerationStreamTokenUrlParams
模块
@huggingface/hub
与 Hub 交互API 参考
类
接口
AuthInfoCachedFileInfoCachedRepoInfoCachedRevisionInfoCommitCopyFileCommitDataCommitDeletedEntryCommitEditFileCommitEditFileParamsCommitFileCommitInfoCommitOutputCopyDestinationCopyFilesEntryCopyProgressEventCopySource凭据DatasetEntryFileDownloadInfoOutputHFCacheInfoJobVolumeLfsPathInfoListFileEntryMlxQuantizationConfigModelConfigModelDerivedFieldsModelEntryOAuthResultParallelDownloadOptionsPathInfoQuantizationConfigRangeEditCacheEntryRepoIdSafetensorsIndexJsonSafetensorsShardFileInfoSecurityFileStatusSpaceEntrySpaceResourceConfigSpaceResourceRequirementSpaceRuntimeTensorInfoUserInfoWhoAmIAppWhoAmIOrgWhoAmIUserXetFileInfoXetReadToken
@huggingface/mcp-client
@huggingface/tiny-agents
@huggingface/space-header
@huggingface/gguf
@huggingface/lerobot
@huggingface/usd-web-viewer
接口:选项
属性
billTo
• Optional billTo: string
用于请求的计费账户。
默认情况下,请求费用将从用户的账户中扣除。 请求只能计入用户所属且已订阅 Enterprise Hub 的组织。
定义于
fetch
• Optional fetch:(input: RequestInfo | URL,init?: RequestInit) => Promise<Response>
用于替代默认函数的自定义 fetch 函数,例如用于使用代理或编辑请求头。
类型声明
▸ (input, init?): Promise<Response>
参数
| 名称 | 类型 |
|---|---|
input | RequestInfo | URL |
init? | RequestInit |
返回
Promise<Response>
定义于
includeCredentials
• Optional includeCredentials: string | boolean
(默认值:“same-origin”)。String | Boolean。用于请求的身份验证凭据。如果该值为字符串,则直接传递。如果为布尔值,true 对应 “include”,false 则完全不发送凭据。
定义于
retry_on_error
• Optional retry_on_error: boolean
(默认值:true)布尔值。如果请求返回 503,则使用相同参数重试该请求。
定义于
signal
• Optional signal: AbortSignal
用于中断请求的 Abort Controller 信号。