跳转到内容

HuggingFaceInferenceAPI

定义于:.build/typescript/packages/providers/huggingface/src/shared.ts:89

Hugging Face推理API的封装器。 API文档:https://huggingface.co/docs/huggingface.js/inference/README 带模型的任务列表:huggingface.co/api/tasks

请注意,推理API尚未支持对话API。 他们建议改用文本生成API。 参见:https://github.com/huggingface/huggingface.js/issues/586#issuecomment-2024059308

  • BaseLLM

new HuggingFaceInferenceAPI(init): HuggingFaceInferenceAPI

定义于:.build/typescript/packages/providers/huggingface/src/shared.ts:97

HFConfig

HuggingFaceInferenceAPI

BaseLLM.constructor

model: string

定义于:.build/typescript/packages/providers/huggingface/src/shared.ts:90


temperature: number

定义于:.build/typescript/packages/providers/huggingface/src/shared.ts:91


topP: number

定义于:.build/typescript/packages/providers/huggingface/src/shared.ts:92


optional maxTokens: number

定义于:.build/typescript/packages/providers/huggingface/src/shared.ts:93


上下文窗口: number

定义于:.build/typescript/packages/providers/huggingface/src/shared.ts:94


hf: HfInference

定义于:.build/typescript/packages/providers/huggingface/src/shared.ts:95

get metadata(): LLMMetadata

定义于:.build/typescript/packages/providers/huggingface/src/shared.ts:118

LLMMetadata

BaseLLM.metadata

chat(params): Promise<AsyncIterable<ChatResponseChunk, any, any>>

定义于:.build/typescript/packages/providers/huggingface/src/shared.ts:130

LLMChatParamsStreaming

Promise<AsyncIterable<ChatResponseChunk, any, any>>

BaseLLM.chat

chat(params): Promise<ChatResponse<object>>

定义于:.build/typescript/packages/providers/huggingface/src/shared.ts:133

LLMChatParamsNonStreaming

Promise<ChatResponse<object>>

BaseLLM.chat


protected nonStreamChat(params): Promise<ChatResponse<object>>

定义于:.build/typescript/packages/providers/huggingface/src/shared.ts:162

LLMChatParamsNonStreaming

Promise<ChatResponse<object>>


protected streamChat(params): AsyncIterable<ChatResponseChunk>

定义于:.build/typescript/packages/providers/huggingface/src/shared.ts:179

LLMChatParamsStreaming

AsyncIterable<ChatResponseChunk>