Skip to content

Commit

Permalink
vectordb
Browse files Browse the repository at this point in the history
  • Loading branch information
chatbookai committed Jun 1, 2024
1 parent 0012a1d commit 46483af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"sqlite3": "^5.1.7",
"useragent": "^2.3.0",
"validator": "^13.11.0",
"vectordb": "^0.1.4",
"vectordb": "^0.4.9",
"xlsx": "^0.18.5"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion express/src/utils/lancedb.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { load } from 'cheerio';
import { BytesOutputParser, StringOutputParser } from '@langchain/core/output_parsers';

import { DataDir } from './const.js';
import { db, getDbRecord, getDbRecordALL } from './db.js'

//import { db, getDbRecord, getDbRecordALL } from './db.js'

import dotenv from 'dotenv';
dotenv.config();
Expand Down
8 changes: 3 additions & 5 deletions express/src/utils/llms.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ import { SystemMessage, HumanMessage, AIMessage } from "@langchain/core/messages
import { ChatMessageHistory } from "langchain/stores/message/in_memory";
import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
import { HarmBlockThreshold, HarmCategory } from "@google/generative-ai";
import { ChatBaiduWenxin } from "@langchain/community/chat_models/baiduwenxin";
//import { ChatBaiduWenxin } from "@langchain/community/chat_models/baiduwenxin";

import { TavilySearchResults } from "@langchain/community/tools/tavily_search";
import { MemoryVectorStore } from "langchain/vectorstores/memory";
import { createRetrieverTool } from "langchain/agents/toolkits";
import { pull } from "langchain/hub";
Expand Down Expand Up @@ -51,9 +50,6 @@ import { DataDir } from './const.js';
import { db, getDbRecord, getDbRecordALL } from './db.js'
import { getLLMSSetting, log, isFile, formatDateString, enableDir, getNanoid, writeFile } from './utils.js'

import { LanceDB } from "@langchain/community/vectorstores/lancedb";
import { connect } from "vectordb";

import { createEmbeddingsFromList, getWebsiteUrlContext, formatMessage, rephraseInput, retrieveContext } from './lancedb.js';

//.ENV
Expand Down Expand Up @@ -525,6 +521,7 @@ let ChatBaiduWenxinModel = null
}

export async function initChatBookBaiduWenxinStream(res, datasetId) {
/*
getLLMSSettingData = await getLLMSSetting(datasetId);
const BAIDU_API_KEY = getLLMSSettingData.OPENAI_API_KEY ?? "1AWXpm1Cd8lbxmAaFoPR0dNx";
const BAIDU_SECRET_KEY = getLLMSSettingData.OPENAI_API_BASE ?? "TQy5sT9Mz4xKn0tR8h7W6LxPWIUNnXqq";
Expand All @@ -548,6 +545,7 @@ let ChatBaiduWenxinModel = null
res.write("Not set API_KEY");
res.end();
}
*/
}

export async function chatChatBaiduWenxin(res, userId, question, history, template, appId) {
Expand Down

0 comments on commit 46483af

Please sign in to comment.