Fix HuggingFace embedding API deprecated endpoints issue
Co-authored-by: HenryHengZJ <26460777+HenryHengZJ@users.noreply.github.com>
This commit is contained in:
parent
858e878def
commit
d26ef485b9
|
|
@ -1,6 +1,6 @@
|
|||
import { INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses } from '../../../src/utils'
|
||||
import { HuggingFaceInferenceEmbeddings, HuggingFaceInferenceEmbeddingsParams } from './core'
|
||||
import { HuggingFaceInferenceEmbeddings, HuggingFaceInferenceEmbeddingsParams } from '@langchain/community/dist/embeddings/hf.cjs'
|
||||
|
||||
class HuggingFaceInferenceEmbedding_Embeddings implements INode {
|
||||
label: string
|
||||
|
|
@ -53,7 +53,7 @@ class HuggingFaceInferenceEmbedding_Embeddings implements INode {
|
|||
}
|
||||
|
||||
if (modelName) obj.model = modelName
|
||||
if (endpoint) obj.endpoint = endpoint
|
||||
if (endpoint) obj.endpointUrl = endpoint
|
||||
|
||||
const model = new HuggingFaceInferenceEmbeddings(obj)
|
||||
return model
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { HfInference } from '@huggingface/inference'
|
||||
import { Embeddings, EmbeddingsParams } from 'langchain/embeddings/base'
|
||||
import { Embeddings, EmbeddingsParams } from '@langchain/core/embeddings'
|
||||
import { getEnvironmentVariable } from '../../../src/utils'
|
||||
|
||||
export interface HuggingFaceInferenceEmbeddingsParams extends EmbeddingsParams {
|
||||
|
|
@ -19,7 +19,11 @@
|
|||
"@aws-sdk/client-dynamodb": "^3.360.0",
|
||||
"@dqbd/tiktoken": "^1.0.7",
|
||||
"@getzep/zep-js": "^0.4.1",
|
||||
"@huggingface/inference": "^2.6.1",
|
||||
"@huggingface/inference": "^4.0.5",
|
||||
"@langchain/community": "^0.3.56",
|
||||
"@langchain/core": "^0.3.78",
|
||||
"@langchain/community": "^0.3.56",
|
||||
"@langchain/core": "^0.3.78",
|
||||
"@opensearch-project/opensearch": "^1.2.0",
|
||||
"@pinecone-database/pinecone": "^0.0.12",
|
||||
"@qdrant/js-client-rest": "^1.2.2",
|
||||
|
|
@ -37,10 +41,11 @@
|
|||
"form-data": "^4.0.0",
|
||||
"graphql": "^16.6.0",
|
||||
"html-to-text": "^9.0.5",
|
||||
"langchain": "^0.0.112",
|
||||
"langchain": "^0.3.34",
|
||||
"linkifyjs": "^4.1.1",
|
||||
"mammoth": "^1.5.1",
|
||||
"moment": "^2.29.3",
|
||||
"mysql2": "^3.5.1",
|
||||
"node-fetch": "^2.6.11",
|
||||
"node-html-markdown": "^1.3.0",
|
||||
"pdf-parse": "^1.1.1",
|
||||
|
|
@ -52,8 +57,7 @@
|
|||
"srt-parser-2": "^1.2.3",
|
||||
"vm2": "^3.9.19",
|
||||
"weaviate-ts-client": "^1.1.0",
|
||||
"ws": "^8.9.0",
|
||||
"mysql2": "^3.5.1"
|
||||
"ws": "^8.9.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/gulp": "4.0.9",
|
||||
|
|
|
|||
Loading…
Reference in New Issue