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
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
optionalmaxTokens:number
定义于:.build/typescript/packages/providers/huggingface/src/shared.ts:93
contextWindow
Section titled “contextWindow”上下文窗口:
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()
Section titled “chat()”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
nonStreamChat()
Section titled “nonStreamChat()”
protectednonStreamChat(params):Promise<ChatResponse<object>>
定义于:.build/typescript/packages/providers/huggingface/src/shared.ts:162
LLMChatParamsNonStreaming
Promise<ChatResponse<object>>
streamChat()
Section titled “streamChat()”
protectedstreamChat(params):AsyncIterable<ChatResponseChunk>
定义于:.build/typescript/packages/providers/huggingface/src/shared.ts:179
LLMChatParamsStreaming
AsyncIterable<ChatResponseChunk>