knowledge.ts 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927
  1. // @ts-ignore
  2. /* eslint-disable */
  3. import request from '@repo/api-client'
  4. /** Excel导入 POST /api/ai/faq/batch_import */
  5. export async function postAiFaqBatchImport(
  6. body: {
  7. knowledge_base_id: string
  8. standard_question: string
  9. similar_questions: string[]
  10. negative_questions: string[]
  11. answers: string[]
  12. is_enabled: boolean
  13. },
  14. options?: { [key: string]: any }
  15. ) {
  16. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  17. '/api/ai/faq/batch_import',
  18. {
  19. method: 'POST',
  20. headers: {
  21. 'Content-Type': 'application/json'
  22. },
  23. data: body,
  24. ...(options || {})
  25. }
  26. )
  27. }
  28. /** 创建单个FAQ条目 POST /api/ai/faq/create */
  29. export async function postAiFaqCreate(
  30. body: {
  31. knowledge_base_id: string
  32. standard_question: string
  33. similar_questions: string[]
  34. negative_questions: string[]
  35. answers: string[]
  36. is_enabled: boolean
  37. },
  38. options?: { [key: string]: any }
  39. ) {
  40. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  41. '/api/ai/faq/create',
  42. {
  43. method: 'POST',
  44. headers: {
  45. 'Content-Type': 'application/json'
  46. },
  47. data: body,
  48. ...(options || {})
  49. }
  50. )
  51. }
  52. /** 删除单个FAQ条目 POST /api/ai/faq/delete */
  53. export async function postAiFaqOpenApiDelete(
  54. body: {
  55. id: string
  56. },
  57. options?: { [key: string]: any }
  58. ) {
  59. return request<Record<string, any>>('/api/ai/faq/delete', {
  60. method: 'POST',
  61. headers: {
  62. 'Content-Type': 'application/json'
  63. },
  64. data: body,
  65. ...(options || {})
  66. })
  67. }
  68. /** 详情 POST /api/ai/faq/info */
  69. export async function postAiFaqInfo(
  70. body: {
  71. id: string
  72. },
  73. options?: { [key: string]: any }
  74. ) {
  75. return request<{
  76. isSuccess: boolean
  77. code: number
  78. result: {
  79. answer_strategy: string
  80. answers: string[]
  81. chunk_id: string
  82. chunk_type: string
  83. creationTime: string
  84. creatorUserId: string
  85. id: string
  86. index_mode: string
  87. is_enabled: boolean
  88. is_recommended: boolean
  89. knowledge_base_id: string
  90. knowledge_id: string
  91. negative_questions: string[]
  92. similar_questions: string[]
  93. standard_question: string
  94. tag_id: string
  95. }
  96. isAuthorized: boolean
  97. }>('/api/ai/faq/info', {
  98. method: 'POST',
  99. headers: {
  100. 'Content-Type': 'application/json'
  101. },
  102. data: body,
  103. ...(options || {})
  104. })
  105. }
  106. /** 分页列表 POST /api/ai/faq/pageList */
  107. export async function postAiFaqPageList(
  108. body: {
  109. knowledge_base_id: string
  110. pageIndex: number
  111. pageSize: number
  112. keyword: string
  113. },
  114. options?: { [key: string]: any }
  115. ) {
  116. return request<{
  117. isSuccess: boolean
  118. code: number
  119. result: {
  120. currentPage: number
  121. hasNextPage: boolean
  122. hasPreviousPage: boolean
  123. model: {
  124. answer_strategy?: string
  125. answers?: string[]
  126. chunk_id?: string
  127. chunk_type?: string
  128. creationTime?: string
  129. creatorUserId?: string
  130. id?: string
  131. index_mode?: string
  132. is_enabled?: boolean
  133. is_recommended?: boolean
  134. knowledge_base_id?: string
  135. knowledge_id?: string
  136. negative_questions?: string[]
  137. similar_questions?: string[]
  138. standard_question?: string
  139. tag_id?: string
  140. }[]
  141. pageSize: number
  142. totalCount: number
  143. totalPages: number
  144. }
  145. isAuthorized: boolean
  146. }>('/api/ai/faq/pageList', {
  147. method: 'POST',
  148. headers: {
  149. 'Content-Type': 'application/json'
  150. },
  151. data: body,
  152. ...(options || {})
  153. })
  154. }
  155. /** 更新单个FAQ条目 POST /api/ai/faq/update */
  156. export async function postAiFaqUpdate(
  157. body: {
  158. id: string
  159. standard_question: string
  160. similar_questions: string[]
  161. negative_questions: string[]
  162. answers: string[]
  163. is_enabled: boolean
  164. },
  165. options?: { [key: string]: any }
  166. ) {
  167. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  168. '/api/ai/faq/update',
  169. {
  170. method: 'POST',
  171. headers: {
  172. 'Content-Type': 'application/json'
  173. },
  174. data: body,
  175. ...(options || {})
  176. }
  177. )
  178. }
  179. /** 创建知识库 POST /api/ai/knowledge-base/create */
  180. export async function postAiKnowledgeBaseCreate(
  181. body: {
  182. name: string
  183. description: string
  184. type: string
  185. wiki_config: {
  186. extraction_granularity: string
  187. max_pages_per_ingest: number
  188. synthesis_model_id: string
  189. }
  190. indexing_strategy: {
  191. graph_enabled: boolean
  192. keyword_enabled: boolean
  193. vector_enabled: boolean
  194. wiki_enabled: boolean
  195. }
  196. chunking_config: {
  197. chunk_size: number
  198. chunk_overlap: number
  199. separators: string[]
  200. parser_engine_rules: { engine: string; file_types: string[] }[]
  201. enable_parent_child: boolean
  202. parent_chunk_size: number
  203. child_chunk_size: number
  204. }
  205. embedding_model_id: string
  206. summary_model_id: string
  207. vlm_config: { model_id: string; enabled: boolean }
  208. asr_config: { model_id: string; language: string; enabled: boolean }
  209. storage_provider_config: { provider: string }
  210. storage_config: { provider: string }
  211. question_generation_config: { enabled: boolean; question_count: number }
  212. },
  213. options?: { [key: string]: any }
  214. ) {
  215. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  216. '/api/ai/knowledge-base/create',
  217. {
  218. method: 'POST',
  219. headers: {
  220. 'Content-Type': 'application/json'
  221. },
  222. data: body,
  223. ...(options || {})
  224. }
  225. )
  226. }
  227. /** 删除知识库 POST /api/ai/knowledge-base/delete */
  228. export async function postAiKnowledgeBaseOpenApiDelete(
  229. body: {
  230. id: string
  231. },
  232. options?: { [key: string]: any }
  233. ) {
  234. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  235. '/api/ai/knowledge-base/delete',
  236. {
  237. method: 'POST',
  238. headers: {
  239. 'Content-Type': 'application/json'
  240. },
  241. data: body,
  242. ...(options || {})
  243. }
  244. )
  245. }
  246. /** 混合搜索 (FAQ) POST /api/ai/knowledge-base/faq_hybrid_search */
  247. export async function postAiKnowledgeBaseFaqHybridSearch(
  248. body: {
  249. knowledge_base_id: string
  250. query_text: string
  251. vector_threshold: number
  252. match_count: number
  253. },
  254. options?: { [key: string]: any }
  255. ) {
  256. return request<{
  257. isSuccess: boolean
  258. code: number
  259. result: {
  260. answer_strategy?: string
  261. answers?: string[]
  262. chunk_id?: string
  263. chunk_type?: string
  264. creationTime?: string
  265. creatorUserId?: string
  266. id?: string
  267. index_mode?: string
  268. is_enabled?: boolean
  269. is_recommended?: boolean
  270. knowledge_base_id?: string
  271. knowledge_id?: string
  272. negative_questions?: string[]
  273. score?: number
  274. similar_questions?: string[]
  275. standard_question?: string
  276. tag_id?: string
  277. }[]
  278. isAuthorized: boolean
  279. }>('/api/ai/knowledge-base/faq_hybrid_search', {
  280. method: 'POST',
  281. headers: {
  282. 'Content-Type': 'application/json'
  283. },
  284. data: body,
  285. ...(options || {})
  286. })
  287. }
  288. /** 混合搜索 POST /api/ai/knowledge-base/hybrid_search */
  289. export async function postAiKnowledgeBaseHybridSearch(
  290. body: {
  291. id: string
  292. query_text: string
  293. vector_threshold: number
  294. keyword_threshold: number
  295. match_count: number
  296. },
  297. options?: { [key: string]: any }
  298. ) {
  299. return request<{ isSuccess: boolean; code: number; result: string[]; isAuthorized: boolean }>(
  300. '/api/ai/knowledge-base/hybrid_search',
  301. {
  302. method: 'POST',
  303. headers: {
  304. 'Content-Type': 'application/json'
  305. },
  306. data: body,
  307. ...(options || {})
  308. }
  309. )
  310. }
  311. /** 根据ids,混合搜索 POST /api/ai/knowledge-base/hybrid_search_ids */
  312. export async function postAiKnowledgeBaseHybridSearchIds(
  313. body: {
  314. query: string
  315. knowledge_base_ids: string[]
  316. knowledge_ids: string[]
  317. },
  318. options?: { [key: string]: any }
  319. ) {
  320. return request<{
  321. isSuccess: boolean
  322. code: number
  323. result: {
  324. chunk_index?: string
  325. chunk_metadata: { generated_questions: { id: string; question: string }[] }
  326. chunk_type?: string
  327. content?: string
  328. end_at?: number
  329. id?: string
  330. image_info?: string
  331. knowledge_base_id?: string
  332. knowledge_channel?: string
  333. knowledge_filename?: string
  334. knowledge_id?: string
  335. knowledge_source?: string
  336. knowledge_title?: string
  337. match_type?: number
  338. metadata: { base_score: string }
  339. parent_chunk_id?: string
  340. score?: number
  341. seq?: number
  342. start_at?: number
  343. sub_chunk_id?: string[]
  344. }[]
  345. isAuthorized: boolean
  346. }>('/api/ai/knowledge-base/hybrid_search_ids', {
  347. method: 'POST',
  348. headers: {
  349. 'Content-Type': 'application/json'
  350. },
  351. data: body,
  352. ...(options || {})
  353. })
  354. }
  355. /** 知识库详情 POST /api/ai/knowledge-base/info */
  356. export async function postAiKnowledgeBaseInfo(
  357. body: {
  358. id: string
  359. },
  360. options?: { [key: string]: any }
  361. ) {
  362. return request<{
  363. isSuccess: boolean
  364. code: number
  365. result: {
  366. asr_config: { enabled: boolean; language: string; model_id: string }
  367. chunking_config: {
  368. child_chunk_size: number
  369. chunk_overlap: number
  370. chunk_size: number
  371. enable_parent_child: boolean
  372. parent_chunk_size: number
  373. parser_engine_rules: { engine: string; file_types: string[] }[]
  374. separators: string[]
  375. }
  376. creationTime: string
  377. creatorUserId: string
  378. description: string
  379. embedding_model_id: string
  380. faq_config: { index_mode: string; question_index_mode: string }
  381. id: string
  382. indexing_strategy: {
  383. graph_enabled: boolean
  384. keyword_enabled: boolean
  385. vector_enabled: boolean
  386. wiki_enabled: boolean
  387. }
  388. isDeleted: boolean
  389. is_pinned: boolean
  390. is_temporary: boolean
  391. name: string
  392. question_generation_config: { enabled: boolean; question_count: number }
  393. storage_config: { provider: string }
  394. storage_provider_config: { provider: string }
  395. summary_model_id: string
  396. type: string
  397. updateTime: string
  398. vlm_config: { enabled: boolean; model_id: string }
  399. wiki_config: {
  400. extraction_granularity: string
  401. max_pages_per_ingest: number
  402. synthesis_model_id: string
  403. }
  404. }
  405. isAuthorized: boolean
  406. }>('/api/ai/knowledge-base/info', {
  407. method: 'POST',
  408. headers: {
  409. 'Content-Type': 'application/json'
  410. },
  411. data: body,
  412. ...(options || {})
  413. })
  414. }
  415. /** 获取知识库分页列表 POST /api/ai/knowledge-base/pageList */
  416. export async function postAiKnowledgeBasePageList(
  417. body: {
  418. keyword: string
  419. type: string
  420. pageIndex: number
  421. pageSize: number
  422. },
  423. options?: { [key: string]: any }
  424. ) {
  425. return request<{
  426. isSuccess: boolean
  427. code: number
  428. result: {
  429. currentPage: number
  430. hasNextPage: boolean
  431. hasPreviousPage: boolean
  432. model: {
  433. asr_config: { enabled: boolean; language: string; model_id: string }
  434. chunking_config: {
  435. child_chunk_size: number
  436. chunk_overlap: number
  437. chunk_size: number
  438. enable_parent_child: boolean
  439. parent_chunk_size: number
  440. parser_engine_rules: { engine: string; file_types: string[] }[]
  441. separators: string[]
  442. }
  443. creationTime: string
  444. creatorUserId: string
  445. description: string
  446. embedding_model_id: string
  447. faq_config: { index_mode: string; question_index_mode: string }
  448. id: string
  449. indexing_strategy: {
  450. graph_enabled: boolean
  451. keyword_enabled: boolean
  452. vector_enabled: boolean
  453. wiki_enabled: boolean
  454. }
  455. isDeleted: boolean
  456. is_pinned: boolean
  457. is_temporary: boolean
  458. name: string
  459. question_generation_config: { enabled: boolean; question_count: number }
  460. storage_config: { provider: string }
  461. storage_provider_config: { provider: string }
  462. summary_model_id: string
  463. type: string
  464. updateTime: string
  465. vlm_config: { enabled: boolean; model_id: string }
  466. wiki_config: {
  467. extraction_granularity: string
  468. max_pages_per_ingest: number
  469. synthesis_model_id: string
  470. }
  471. extract_config: { enabled: boolean }
  472. }[]
  473. pageSize: number
  474. totalCount: number
  475. totalPages: number
  476. }
  477. isAuthorized: boolean
  478. }>('/api/ai/knowledge-base/pageList', {
  479. method: 'POST',
  480. headers: {
  481. 'Content-Type': 'application/json'
  482. },
  483. data: body,
  484. ...(options || {})
  485. })
  486. }
  487. /** 获取知识库选择列表 POST /api/ai/knowledge-base/selectList */
  488. export async function postAiKnowledgeBaseSelectList(
  489. body: {
  490. keyword?: string
  491. type?: string
  492. },
  493. options?: { [key: string]: any }
  494. ) {
  495. return request<{
  496. isSuccess: boolean
  497. code: number
  498. result: {
  499. asr_config: { enabled: boolean; language: string; model_id: string }
  500. chunking_config: {
  501. child_chunk_size: number
  502. chunk_overlap: number
  503. chunk_size: number
  504. enable_parent_child: boolean
  505. parent_chunk_size: number
  506. parser_engine_rules: { engine: string; file_types: string[] }[]
  507. separators: string[]
  508. }
  509. creationTime: string
  510. creatorUserId: string
  511. description: string
  512. embedding_model_id: string
  513. faq_config: { index_mode: string; question_index_mode: string }
  514. id: string
  515. indexing_strategy: {
  516. graph_enabled: boolean
  517. keyword_enabled: boolean
  518. vector_enabled: boolean
  519. wiki_enabled: boolean
  520. }
  521. isDeleted: boolean
  522. is_pinned: boolean
  523. is_temporary: boolean
  524. name: string
  525. question_generation_config: { enabled: boolean; question_count: number }
  526. storage_config: { provider: string }
  527. storage_provider_config: { provider: string }
  528. summary_model_id: string
  529. type: string
  530. updateTime: string
  531. vlm_config: { enabled: boolean; model_id: string }
  532. wiki_config: {
  533. extraction_granularity: string
  534. max_pages_per_ingest: number
  535. synthesis_model_id: string
  536. }
  537. extract_config: { enabled: boolean }
  538. }[]
  539. isAuthorized: boolean
  540. }>('/api/ai/knowledge-base/selectList', {
  541. method: 'POST',
  542. headers: {
  543. 'Content-Type': 'application/json'
  544. },
  545. data: body,
  546. ...(options || {})
  547. })
  548. }
  549. /** 更新知识库 POST /api/ai/knowledge-base/update */
  550. export async function postAiKnowledgeBaseUpdate(
  551. body: {
  552. id: string
  553. name: string
  554. description: string
  555. wiki_config: {
  556. extraction_granularity: string
  557. max_pages_per_ingest: number
  558. synthesis_model_id: string
  559. }
  560. indexing_strategy: {
  561. graph_enabled: boolean
  562. keyword_enabled: boolean
  563. vector_enabled: boolean
  564. wiki_enabled: boolean
  565. }
  566. chunking_config: {
  567. chunk_size: number
  568. chunk_overlap: number
  569. separators: string[]
  570. parser_engine_rules: { engine: string; file_types: string[] }[]
  571. enable_parent_child: boolean
  572. parent_chunk_size: number
  573. child_chunk_size: number
  574. }
  575. embedding_model_id: string
  576. summary_model_id: string
  577. vlm_config: { model_id: string; enabled: boolean }
  578. asr_config: { model_id: string; language: string; enabled: boolean }
  579. storage_provider_config: { provider: string }
  580. storage_config: { provider: string }
  581. question_generation_config: { enabled: boolean; question_count: number }
  582. },
  583. options?: { [key: string]: any }
  584. ) {
  585. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  586. '/api/ai/knowledge-base/update',
  587. {
  588. method: 'POST',
  589. headers: {
  590. 'Content-Type': 'application/json'
  591. },
  592. data: body,
  593. ...(options || {})
  594. }
  595. )
  596. }
  597. /** 创建来自文件的知识 POST /api/ai/knowledge/createWithFile */
  598. export async function postAiKnowledgeCreateWithFile(
  599. body: {
  600. knowledge_base_id: string
  601. fileId: string
  602. metadata: Record<string, any>
  603. enable_multi_model: boolean
  604. },
  605. options?: { [key: string]: any }
  606. ) {
  607. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  608. '/api/ai/knowledge/createWithFile',
  609. {
  610. method: 'POST',
  611. headers: {
  612. 'Content-Type': 'application/json'
  613. },
  614. data: body,
  615. ...(options || {})
  616. }
  617. )
  618. }
  619. /** 创建自定义知识 POST /api/ai/knowledge/createWithManual */
  620. export async function postAiKnowledgeCreateWithManual(
  621. body: {
  622. knowledge_base_id: string
  623. title: string
  624. content: string
  625. publish: boolean
  626. },
  627. options?: { [key: string]: any }
  628. ) {
  629. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  630. '/api/ai/knowledge/createWithManual',
  631. {
  632. method: 'POST',
  633. headers: {
  634. 'Content-Type': 'application/json'
  635. },
  636. data: body,
  637. ...(options || {})
  638. }
  639. )
  640. }
  641. /** 删除知识 POST /api/ai/knowledge/delete */
  642. export async function postAiKnowledgeOpenApiDelete(
  643. body: {
  644. id: string
  645. },
  646. options?: { [key: string]: any }
  647. ) {
  648. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  649. '/api/ai/knowledge/delete',
  650. {
  651. method: 'POST',
  652. headers: {
  653. 'Content-Type': 'application/json'
  654. },
  655. data: body,
  656. ...(options || {})
  657. }
  658. )
  659. }
  660. /** 获取详情 POST /api/ai/knowledge/info */
  661. export async function postAiKnowledgeInfo(
  662. body: {
  663. id: string
  664. },
  665. options?: { [key: string]: any }
  666. ) {
  667. return request<{
  668. isSuccess: boolean
  669. code: number
  670. result: {
  671. channel: string
  672. creationTime: string
  673. description: string
  674. embedding_model_id: string
  675. enable_status: string
  676. error_message: string
  677. file_hash: string
  678. file_name: string
  679. file_path: string
  680. file_size: number
  681. file_type: string
  682. id: string
  683. isDeleted: boolean
  684. knowledge_base_id: string
  685. metadata: {
  686. updated_at: string
  687. format: string
  688. version: number
  689. content: string
  690. status: string
  691. }
  692. parse_status: string
  693. source: string
  694. storage_size: number
  695. summary_status: string
  696. tag_id: string
  697. title: string
  698. type: string
  699. updateTime: string
  700. userId: string
  701. }
  702. isAuthorized: boolean
  703. }>('/api/ai/knowledge/info', {
  704. method: 'POST',
  705. headers: {
  706. 'Content-Type': 'application/json'
  707. },
  708. data: body,
  709. ...(options || {})
  710. })
  711. }
  712. /** 获取知识分页列表 POST /api/ai/knowledge/pageList */
  713. export async function postAiKnowledgePageList(
  714. body: {
  715. knowledge_base_id: string
  716. title: string
  717. file_type: string
  718. pageIndex: number
  719. pageSize: number
  720. },
  721. options?: { [key: string]: any }
  722. ) {
  723. return request<{
  724. isSuccess: boolean
  725. code: number
  726. result: {
  727. currentPage: number
  728. hasNextPage: boolean
  729. hasPreviousPage: boolean
  730. model: {
  731. channel?: string
  732. creationTime?: string
  733. description?: string
  734. embedding_model_id?: string
  735. enable_status?: string
  736. error_message?: string
  737. file_hash?: string
  738. file_name?: string
  739. file_path?: string
  740. file_size?: number
  741. file_type?: string
  742. id?: string
  743. isDeleted?: boolean
  744. knowledge_base_id?: string
  745. metadata?: Record<string, any>
  746. parse_status?: string
  747. source?: string
  748. storage_size?: number
  749. summary_status?: string
  750. tag_id?: string
  751. title?: string
  752. type?: string
  753. updateTime?: string
  754. }[]
  755. pageSize: number
  756. totalCount: number
  757. totalPages: number
  758. }
  759. isAuthorized: boolean
  760. }>('/api/ai/knowledge/pageList', {
  761. method: 'POST',
  762. headers: {
  763. 'Content-Type': 'application/json'
  764. },
  765. data: body,
  766. ...(options || {})
  767. })
  768. }
  769. /** 重新解析知识 POST /api/ai/knowledge/reparse */
  770. export async function postAiKnowledgeReparse(
  771. body: {
  772. id: string
  773. },
  774. options?: { [key: string]: any }
  775. ) {
  776. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  777. '/api/ai/knowledge/reparse',
  778. {
  779. method: 'POST',
  780. headers: {
  781. 'Content-Type': 'application/json'
  782. },
  783. data: body,
  784. ...(options || {})
  785. }
  786. )
  787. }
  788. /** 获取知识选择列表 POST /api/ai/knowledge/selectList */
  789. export async function postAiKnowledgeSelectList(
  790. body: {
  791. knowledge_base_id: string
  792. title?: string
  793. },
  794. options?: { [key: string]: any }
  795. ) {
  796. return request<{
  797. isSuccess: boolean
  798. code: number
  799. result: {
  800. currentPage: number
  801. hasNextPage: boolean
  802. hasPreviousPage: boolean
  803. model: {
  804. channel?: string
  805. creationTime?: string
  806. description?: string
  807. embedding_model_id?: string
  808. enable_status?: string
  809. error_message?: string
  810. file_hash?: string
  811. file_name?: string
  812. file_path?: string
  813. file_size?: number
  814. file_type?: string
  815. id?: string
  816. isDeleted?: boolean
  817. knowledge_base_id?: string
  818. metadata?: Record<string, any>
  819. parse_status?: string
  820. source?: string
  821. storage_size?: number
  822. summary_status?: string
  823. tag_id?: string
  824. title?: string
  825. type?: string
  826. updateTime?: string
  827. }[]
  828. pageSize: number
  829. totalCount: number
  830. totalPages: number
  831. }
  832. isAuthorized: boolean
  833. }>('/api/ai/knowledge/selectList', {
  834. method: 'POST',
  835. headers: {
  836. 'Content-Type': 'application/json'
  837. },
  838. data: body,
  839. ...(options || {})
  840. })
  841. }
  842. /** 更新知识 POST /api/ai/knowledge/update */
  843. export async function postAiKnowledgeUpdate(
  844. body: {
  845. id: string
  846. title: string
  847. description: string
  848. },
  849. options?: { [key: string]: any }
  850. ) {
  851. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  852. '/api/ai/knowledge/update',
  853. {
  854. method: 'POST',
  855. headers: {
  856. 'Content-Type': 'application/json'
  857. },
  858. data: body,
  859. ...(options || {})
  860. }
  861. )
  862. }
  863. /** 查询异步任务状态 状态 0: 已创建 1: 运行中 2: 成功 3: 失败 4: 挂起 POST /api/bpm/getAsynTaskInfo */
  864. export async function postBpmGetAsynTaskInfo(
  865. body: {
  866. id: string
  867. },
  868. options?: { [key: string]: any }
  869. ) {
  870. return request<{
  871. isSuccess: boolean
  872. code: number
  873. result: {
  874. appPageCode: string
  875. argsInput: { args: { name?: string; value?: string }[] }
  876. code: string
  877. creationTime: string
  878. creatorUserId: string
  879. downFileId: string
  880. entityId: string
  881. fileId: string
  882. htmlStatusInfo: string
  883. id: string
  884. isDeleted: boolean
  885. nodeId: string
  886. params: string
  887. progress: string
  888. status: number
  889. taskId: string
  890. type: number
  891. updateTime: string
  892. }
  893. isAuthorized: boolean
  894. }>('/api/bpm/getAsynTaskInfo', {
  895. method: 'POST',
  896. headers: {
  897. 'Content-Type': 'application/json'
  898. },
  899. data: body,
  900. ...(options || {})
  901. })
  902. }