temp
This commit is contained in:
@@ -17,7 +17,7 @@ export class KnowledgeBase extends CNBCore {
|
|||||||
metadata_filtering_conditions?: MetadataFilteringConditions
|
metadata_filtering_conditions?: MetadataFilteringConditions
|
||||||
}): Promise<any> {
|
}): Promise<any> {
|
||||||
const group = this.group || '';
|
const group = this.group || '';
|
||||||
const url = `/${group}/${repo}/-/knowledge/query`;
|
const url = `/${group}/${repo}/-/knowledge/base/query`;
|
||||||
let postData = {
|
let postData = {
|
||||||
query: data.query,
|
query: data.query,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -29,3 +29,15 @@ export const showMore = (obj: any) => {
|
|||||||
// });
|
// });
|
||||||
|
|
||||||
// console.log("start", start);
|
// console.log("start", start);
|
||||||
|
// const start = await cnb.workspace.startWorkspace('kevisual/assistant-app', {
|
||||||
|
// branch: 'main',
|
||||||
|
// });
|
||||||
|
// if(start.data) {
|
||||||
|
// const url = start.data.url;
|
||||||
|
// console.log("url", url);
|
||||||
|
// const consoleUrl = cnb.workspace.getConsoleUrl(url);
|
||||||
|
// console.log("consoleUrl", consoleUrl);
|
||||||
|
// }
|
||||||
|
// console.log("start", start);
|
||||||
|
// const deteail = await cnb.workspace.getDetail('kevisual/assistant-app',sn);
|
||||||
|
// console.log("deteail", showMore(deteail));
|
||||||
|
|||||||
@@ -2,9 +2,15 @@ import { KnowledgeBase } from "../src/knowledge/index.ts";
|
|||||||
|
|
||||||
import { token, showMore, cookie } from "./common.ts";
|
import { token, showMore, cookie } from "./common.ts";
|
||||||
|
|
||||||
const repo = new KnowledgeBase({ group: "kevisual/demo", token: token, cookie: cookie });
|
const repo = new KnowledgeBase({ group: "kevisual/test", token: token, cookie: cookie });
|
||||||
const repoName = "test-cnb";
|
const repoName = "test-local-docs";
|
||||||
|
|
||||||
const queryRes = await repo.getEmbeddingModels(repoName);
|
// const queryRes = await repo.getEmbeddingModels(repoName);
|
||||||
|
|
||||||
console.log("queryRes", showMore(queryRes));
|
// console.log("queryRes", showMore(queryRes));
|
||||||
|
|
||||||
|
const chat = await repo.queryKnowledgeBase(repoName, {
|
||||||
|
query: "播放音乐的地址",
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("chat", showMore(chat));
|
||||||
Reference in New Issue
Block a user