Chore/LC v0.3 (#3517)

* bump langchain version to 0.3, upgrades on all chat models

* update all docs loader to have documents and text output options

* fix pnpm lock file
This commit is contained in:
Henry Heng
2024-11-28 11:06:12 +00:00
committed by GitHub
parent 126808b62a
commit 940c8fd3b0
82 changed files with 2373 additions and 1540 deletions
@@ -1,6 +1,5 @@
import { GoogleAuthOptions } from 'google-auth-library'
import { BaseCache } from '@langchain/core/caches'
import { GoogleVertexAI, GoogleVertexAITextInput } from '@langchain/community/llms/googlevertexai'
import { VertexAI, VertexAIInput } from '@langchain/google-vertexai'
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
@@ -25,7 +24,7 @@ class GoogleVertexAI_LLMs implements INode {
this.icon = 'GoogleVertex.svg'
this.category = 'LLMs'
this.description = 'Wrapper around GoogleVertexAI large language models'
this.baseClasses = [this.type, ...getBaseClasses(GoogleVertexAI)]
this.baseClasses = [this.type, ...getBaseClasses(VertexAI)]
this.credential = {
label: 'Connect Credential',
name: 'credential',
@@ -89,7 +88,7 @@ class GoogleVertexAI_LLMs implements INode {
const googleApplicationCredential = getCredentialParam('googleApplicationCredential', credentialData, nodeData)
const projectID = getCredentialParam('projectID', credentialData, nodeData)
const authOptions: GoogleAuthOptions = {}
const authOptions: any = {}
if (Object.keys(credentialData).length !== 0) {
if (!googleApplicationCredentialFilePath && !googleApplicationCredential)
throw new Error('Please specify your Google Application Credential')
@@ -112,7 +111,7 @@ class GoogleVertexAI_LLMs implements INode {
const topP = nodeData.inputs?.topP as string
const cache = nodeData.inputs?.cache as BaseCache
const obj: Partial<GoogleVertexAITextInput> = {
const obj: Partial<VertexAIInput> = {
temperature: parseFloat(temperature),
model: modelName
}
@@ -122,7 +121,7 @@ class GoogleVertexAI_LLMs implements INode {
if (topP) obj.topP = parseFloat(topP)
if (cache) obj.cache = cache
const model = new GoogleVertexAI(obj)
const model = new VertexAI(obj)
return model
}
}