@re-ai/volc-knowledge
Version:
火山引擎知识库接口接入SDK
60 lines (59 loc) • 1.86 kB
TypeScript
import { ListKnowledgeRequest, ListKnowledgeResponse } from "../types/knowledge";
import { ApiResponse } from "../utils/request";
/**
* 知识库相关接口定义
*/
export interface IKnowledgeAPI {
/**
* 创建知识库
* @param params 创建参数
*/
create(params: Record<string, any>): Promise<any>;
/**
* 更新知识库
* @param knowledgeId 知识库ID
* @param updateData 更新数据
*/
update(knowledgeId: string, updateData: Record<string, any>): Promise<any>;
/**
* 获取知识库信息
* @param knowledgeId 知识库ID
*/
info(knowledgeId: string): Promise<any>;
/**
* 列出知识库
* @param params 查询参数
*/
list(params?: ListKnowledgeRequest): Promise<ApiResponse<ListKnowledgeResponse>>;
/**
* 删除知识库
* @param knowledgeId 知识库ID
*/
delete(knowledgeId: string): Promise<any>;
/**
* 知识库检索(旧版)
* @param query 查询内容
* @param options 查询选项
* @deprecated 即将下线,请使用searchKnowledge替代
*/
search(query: string, options?: Record<string, any>): Promise<any>;
/**
* 知识库检索与生成(旧版)
* @param query 查询内容
* @param options 查询选项
* @deprecated 即将下线,请使用searchKnowledge替代
*/
searchAndGenerate(query: string, options?: Record<string, any>): Promise<any>;
/**
* 知识库检索(新版)
* @param query 查询内容
* @param options 查询选项
*/
searchKnowledge(query: string, options?: Record<string, any>): Promise<any>;
/**
* 知识库多轮问答
* @param messages 消息列表
* @param options 查询选项
*/
chatCompletions(messages: Array<any>, options?: Record<string, any>): Promise<any>;
}