resource.ts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859
  1. // @ts-ignore
  2. /* eslint-disable */
  3. import request from '@repo/api-client'
  4. /** 测试MCP服务连接 POST /api/ai/mcp/check */
  5. export async function postMcpCheck(
  6. body: {
  7. id: string
  8. },
  9. options?: { [key: string]: any }
  10. ) {
  11. return request<{
  12. isSuccess: boolean
  13. code: number
  14. result: {
  15. message: string
  16. tools: {
  17. description: string
  18. inputSchema: {
  19. type: string
  20. properties: {
  21. value: { description: string; type: string }
  22. usn: { description: string; type: string }
  23. loginType: { description: string; type: string }
  24. loginWay: { description: string; type: string }
  25. pwd: { description: string; type: string }
  26. token: { description: string; type: string }
  27. }
  28. required: string[]
  29. }
  30. name: string
  31. }[]
  32. }
  33. isAuthorized: boolean
  34. }>('/api/ai/mcp/check', {
  35. method: 'POST',
  36. headers: {
  37. 'Content-Type': 'application/json'
  38. },
  39. data: body,
  40. ...(options || {})
  41. })
  42. }
  43. /** 创建MCP POST /api/ai/mcp/create */
  44. export async function postMcpCreate(
  45. body: {
  46. name: string
  47. description: string
  48. transport_type: string
  49. url: string
  50. enabled: boolean
  51. headers: Record<string, any>
  52. auth_config: Record<string, any>
  53. advanced_config: { timeout: number; retry_count: number; retry_delay: number }
  54. env_vars: Record<string, any>
  55. },
  56. options?: { [key: string]: any }
  57. ) {
  58. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  59. '/api/ai/mcp/create',
  60. {
  61. method: 'POST',
  62. headers: {
  63. 'Content-Type': 'application/json'
  64. },
  65. data: body,
  66. ...(options || {})
  67. }
  68. )
  69. }
  70. /** 删除MCP POST /api/ai/mcp/delete */
  71. export async function postMcpOpenApiDelete(
  72. body: {
  73. id: string
  74. },
  75. options?: { [key: string]: any }
  76. ) {
  77. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  78. '/api/ai/mcp/delete',
  79. {
  80. method: 'POST',
  81. headers: {
  82. 'Content-Type': 'application/json'
  83. },
  84. data: body,
  85. ...(options || {})
  86. }
  87. )
  88. }
  89. /** 获取详情 POST /api/ai/mcp/info */
  90. export async function postMcpInfo(
  91. body: {
  92. id: string
  93. },
  94. options?: { [key: string]: any }
  95. ) {
  96. return request<{
  97. isSuccess: boolean
  98. code: number
  99. result: {
  100. advanced_config: { retry_count: number; retry_delay: number; timeout: number }
  101. auth_config: Record<string, any>
  102. creationTime: string
  103. creatorUserId: string
  104. description: string
  105. enabled: boolean
  106. env_vars: Record<string, any>
  107. headers: Record<string, any>
  108. id: string
  109. isDeleted: boolean
  110. is_builtin: boolean
  111. name: string
  112. stdio_config: { command: string }
  113. transport_type: string
  114. updateTime: string
  115. url: string
  116. }
  117. isAuthorized: boolean
  118. }>('/api/ai/mcp/info', {
  119. method: 'POST',
  120. headers: {
  121. 'Content-Type': 'application/json'
  122. },
  123. data: body,
  124. ...(options || {})
  125. })
  126. }
  127. /** 获取分页列表 POST /api/ai/mcp/pageList */
  128. export async function postMcpPageList(
  129. body: {
  130. keyword: string
  131. transport_type: string
  132. pageIndex: number
  133. pageSize: number
  134. },
  135. options?: { [key: string]: any }
  136. ) {
  137. return request<{
  138. isSuccess: boolean
  139. code: number
  140. result: {
  141. currentPage: number
  142. hasNextPage: boolean
  143. hasPreviousPage: boolean
  144. model: {
  145. advanced_config: { retry_count: number; retry_delay: number; timeout: number }
  146. auth_config?: Record<string, any>
  147. creationTime?: string
  148. creatorUserId?: string
  149. description?: string
  150. enabled?: boolean
  151. env_vars?: Record<string, any>
  152. headers?: Record<string, any>
  153. id?: string
  154. isDeleted?: boolean
  155. is_builtin?: boolean
  156. name?: string
  157. stdio_config: { command: string }
  158. transport_type?: string
  159. updateTime?: string
  160. url?: string
  161. }[]
  162. pageSize: number
  163. totalCount: number
  164. totalPages: number
  165. }
  166. isAuthorized: boolean
  167. }>('/api/ai/mcp/pageList', {
  168. method: 'POST',
  169. headers: {
  170. 'Content-Type': 'application/json'
  171. },
  172. data: body,
  173. ...(options || {})
  174. })
  175. }
  176. /** 获取MCP服务资源表 POST /api/ai/mcp/resources */
  177. export async function postMcpResources(
  178. body: {
  179. id: string
  180. },
  181. options?: { [key: string]: any }
  182. ) {
  183. return request<{ isSuccess: boolean; code: number; result: string[]; isAuthorized: boolean }>(
  184. '/api/ai/mcp/resources',
  185. {
  186. method: 'POST',
  187. headers: {
  188. 'Content-Type': 'application/json'
  189. },
  190. data: body,
  191. ...(options || {})
  192. }
  193. )
  194. }
  195. /** MCP选择列表 POST /api/ai/mcp/selectList */
  196. export async function postMcpSelectList(
  197. body: {
  198. keyword: string
  199. },
  200. options?: { [key: string]: any }
  201. ) {
  202. return request<{
  203. isSuccess: boolean
  204. code: number
  205. result: { id: string; name: string }[]
  206. isAuthorized: boolean
  207. }>('/api/ai/mcp/selectList', {
  208. method: 'POST',
  209. headers: {
  210. 'Content-Type': 'application/json'
  211. },
  212. data: body,
  213. ...(options || {})
  214. })
  215. }
  216. /** 获取MCP服务工具列表 POST /api/ai/mcp/tools */
  217. export async function postMcpTools(
  218. body: {
  219. id: string
  220. },
  221. options?: { [key: string]: any }
  222. ) {
  223. return request<{
  224. isSuccess: boolean
  225. code: number
  226. result: {
  227. description: string
  228. inputSchema: {
  229. type: string
  230. properties: {
  231. value: { description: string; type: string }
  232. token: { description: string; type: string }
  233. usn: { description: string; type: string }
  234. loginType: { description: string; type: string }
  235. loginWay: { description: string; type: string }
  236. pwd: { description: string; type: string }
  237. }
  238. required: string[]
  239. }
  240. name: string
  241. }[]
  242. isAuthorized: boolean
  243. }>('/api/ai/mcp/tools', {
  244. method: 'POST',
  245. headers: {
  246. 'Content-Type': 'application/json'
  247. },
  248. data: body,
  249. ...(options || {})
  250. })
  251. }
  252. /** 更新MCP POST /api/ai/mcp/update */
  253. export async function postMcpUpdate(
  254. body: {
  255. id: string
  256. name: string
  257. description: string
  258. transport_type: string
  259. url: string
  260. enabled: boolean
  261. headers: Record<string, any>
  262. auth_config: Record<string, any>
  263. advanced_config: { timeout: number; retry_count: number; retry_delay: number }
  264. env_vars: Record<string, any>
  265. },
  266. options?: { [key: string]: any }
  267. ) {
  268. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  269. '/api/ai/mcp/update',
  270. {
  271. method: 'POST',
  272. headers: {
  273. 'Content-Type': 'application/json'
  274. },
  275. data: body,
  276. ...(options || {})
  277. }
  278. )
  279. }
  280. /** 获取系统提示词及模版信息 POST /api/ai/prompt-template/config */
  281. export async function postPromptTemplateConfig(body: {}, options?: { [key: string]: any }) {
  282. return request<{
  283. isSuccess: boolean
  284. code: number
  285. result: {
  286. agent_system_prompts: {
  287. content: string
  288. creationTime: string
  289. default: boolean
  290. description: string
  291. has_knowledge_base: boolean
  292. has_web_search: boolean
  293. id: string
  294. isDeleted: boolean
  295. is_builtin: boolean
  296. mode: string
  297. name: string
  298. type: string
  299. updateTime: string
  300. value: string
  301. }[]
  302. context_templates: {
  303. content: string
  304. creationTime: string
  305. default: boolean
  306. description: string
  307. has_knowledge_base: boolean
  308. has_web_search: boolean
  309. id: string
  310. isDeleted: boolean
  311. is_builtin: boolean
  312. mode: string
  313. name: string
  314. type: string
  315. updateTime: string
  316. value: string
  317. }[]
  318. defaultSystemAgentPrompt: {
  319. content: string
  320. creationTime: string
  321. default: boolean
  322. description: string
  323. has_knowledge_base: boolean
  324. has_web_search: boolean
  325. id: string
  326. isDeleted: boolean
  327. is_builtin: boolean
  328. mode: string
  329. name: string
  330. type: string
  331. updateTime: string
  332. value: string
  333. }
  334. defaultSystemContextTemplate: {
  335. content: string
  336. creationTime: string
  337. default: boolean
  338. description: string
  339. has_knowledge_base: boolean
  340. has_web_search: boolean
  341. id: string
  342. isDeleted: boolean
  343. is_builtin: boolean
  344. mode: string
  345. name: string
  346. type: string
  347. updateTime: string
  348. value: string
  349. }
  350. defaultSystemFallBack: {
  351. content: string
  352. creationTime: string
  353. default: boolean
  354. description: string
  355. has_knowledge_base: boolean
  356. has_web_search: boolean
  357. id: string
  358. isDeleted: boolean
  359. is_builtin: boolean
  360. mode: string
  361. name: string
  362. type: string
  363. updateTime: string
  364. value: string
  365. }
  366. defaultSystemPrompt: {
  367. content: string
  368. creationTime: string
  369. default: boolean
  370. description: string
  371. has_knowledge_base: boolean
  372. has_web_search: boolean
  373. id: string
  374. isDeleted: boolean
  375. is_builtin: boolean
  376. mode: string
  377. name: string
  378. type: string
  379. updateTime: string
  380. value: string
  381. }
  382. defaultSystemRewrite: {
  383. content: string
  384. creationTime: string
  385. default: boolean
  386. description: string
  387. has_knowledge_base: boolean
  388. has_web_search: boolean
  389. id: string
  390. isDeleted: boolean
  391. is_builtin: boolean
  392. mode: string
  393. name: string
  394. type: string
  395. updateTime: string
  396. user: string
  397. value: string
  398. }
  399. fall_backs: {
  400. content: string
  401. creationTime: string
  402. default: boolean
  403. description: string
  404. has_knowledge_base: boolean
  405. has_web_search: boolean
  406. id: string
  407. isDeleted: boolean
  408. is_builtin: boolean
  409. mode: string
  410. name: string
  411. type: string
  412. updateTime: string
  413. value: string
  414. }[]
  415. rewrites: {
  416. content: string
  417. creationTime: string
  418. default: boolean
  419. description: string
  420. has_knowledge_base: boolean
  421. has_web_search: boolean
  422. id: string
  423. isDeleted: boolean
  424. is_builtin: boolean
  425. mode: string
  426. name: string
  427. type: string
  428. updateTime: string
  429. user: string
  430. value: string
  431. }[]
  432. system_prompts: {
  433. content: string
  434. creationTime: string
  435. default: boolean
  436. description: string
  437. has_knowledge_base: boolean
  438. has_web_search: boolean
  439. id: string
  440. isDeleted: boolean
  441. is_builtin: boolean
  442. mode: string
  443. name: string
  444. type: string
  445. updateTime: string
  446. value: string
  447. }[]
  448. }
  449. isAuthorized: boolean
  450. }>('/api/ai/prompt-template/config', {
  451. method: 'POST',
  452. headers: {
  453. 'Content-Type': 'application/json'
  454. },
  455. data: body,
  456. ...(options || {})
  457. })
  458. }
  459. /** 创建提示词与模版 POST /api/ai/prompt-template/create */
  460. export async function postPromptTemplateCreate(
  461. body: {
  462. name: string
  463. description: string
  464. content: string
  465. user: string
  466. type: string
  467. is_default: boolean
  468. has_knowledge_base: boolean
  469. has_web_search: boolean
  470. },
  471. options?: { [key: string]: any }
  472. ) {
  473. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  474. '/api/ai/prompt-template/create',
  475. {
  476. method: 'POST',
  477. headers: {
  478. 'Content-Type': 'application/json'
  479. },
  480. data: body,
  481. ...(options || {})
  482. }
  483. )
  484. }
  485. /** 删除提示词与模版 POST /api/ai/prompt-template/delete */
  486. export async function postPromptTemplateOpenApiDelete(
  487. body: {
  488. id: string
  489. },
  490. options?: { [key: string]: any }
  491. ) {
  492. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  493. '/api/ai/prompt-template/delete',
  494. {
  495. method: 'POST',
  496. headers: {
  497. 'Content-Type': 'application/json'
  498. },
  499. data: body,
  500. ...(options || {})
  501. }
  502. )
  503. }
  504. /** 初始化系统内置提示词和模版 POST /api/ai/prompt-template/initPromptContext */
  505. export async function postPromptTemplateInitPromptContext(
  506. body: {},
  507. options?: { [key: string]: any }
  508. ) {
  509. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  510. '/api/ai/prompt-template/initPromptContext',
  511. {
  512. method: 'POST',
  513. headers: {
  514. 'Content-Type': 'application/json'
  515. },
  516. data: body,
  517. ...(options || {})
  518. }
  519. )
  520. }
  521. /** 获取分页列表 POST /api/ai/prompt-template/pageList */
  522. export async function postPromptTemplatePageList(
  523. body: {
  524. keyword?: string
  525. pageIndex?: number
  526. pageSize?: number
  527. type?: string
  528. },
  529. options?: { [key: string]: any }
  530. ) {
  531. return request<{
  532. isSuccess: boolean
  533. code: number
  534. result: {
  535. currentPage: number
  536. hasNextPage: boolean
  537. hasPreviousPage: boolean
  538. model: {
  539. content: string
  540. creationTime: string
  541. default: boolean
  542. description: string
  543. has_knowledge_base: boolean
  544. has_web_search: boolean
  545. id: string
  546. isDeleted: boolean
  547. is_builtin: boolean
  548. mode: string
  549. name: string
  550. source: string
  551. type: string
  552. updateTime: string
  553. value: string
  554. user: string
  555. }[]
  556. pageSize: number
  557. totalCount: number
  558. totalPages: number
  559. }
  560. isAuthorized: boolean
  561. }>('/api/ai/prompt-template/pageList', {
  562. method: 'POST',
  563. headers: {
  564. 'Content-Type': 'application/json'
  565. },
  566. data: body,
  567. ...(options || {})
  568. })
  569. }
  570. /** 修改提示词与模版 POST /api/ai/prompt-template/update */
  571. export async function postPromptTemplateUpdate(
  572. body: {
  573. id: string
  574. name: string
  575. description: string
  576. content: string
  577. user: string
  578. type: string
  579. is_default: boolean
  580. has_knowledge_base: boolean
  581. has_web_search: boolean
  582. },
  583. options?: { [key: string]: any }
  584. ) {
  585. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  586. '/api/ai/prompt-template/update',
  587. {
  588. method: 'POST',
  589. headers: {
  590. 'Content-Type': 'application/json'
  591. },
  592. data: body,
  593. ...(options || {})
  594. }
  595. )
  596. }
  597. /** 获取支持的Skills列表 POST /api/ai/skills/list */
  598. export async function postSkillsList(body: {}, options?: { [key: string]: any }) {
  599. return request<{
  600. isSuccess: boolean
  601. code: number
  602. result: { description: string; name: string }[]
  603. isAuthorized: boolean
  604. }>('/api/ai/skills/list', {
  605. method: 'POST',
  606. headers: {
  607. 'Content-Type': 'application/json'
  608. },
  609. data: body,
  610. ...(options || {})
  611. })
  612. }
  613. /** 测试已保存的 Provider POST /api/ai/web-search/checkById */
  614. export async function postWebSearchCheckById(
  615. body: {
  616. id: string
  617. },
  618. options?: { [key: string]: any }
  619. ) {
  620. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  621. '/api/ai/web-search/checkById',
  622. {
  623. method: 'POST',
  624. headers: {
  625. 'Content-Type': 'application/json'
  626. },
  627. data: body,
  628. ...(options || {})
  629. }
  630. )
  631. }
  632. /** 使用原始凭证测试连通性 POST /api/ai/web-search/checkWithParameters */
  633. export async function postWebSearchCheckWithParameters(
  634. body: {
  635. provider: string
  636. parameters: { api_key: string; proxy_url: string; engine_id: string }
  637. },
  638. options?: { [key: string]: any }
  639. ) {
  640. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  641. '/api/ai/web-search/checkWithParameters',
  642. {
  643. method: 'POST',
  644. headers: {
  645. 'Content-Type': 'application/json'
  646. },
  647. data: body,
  648. ...(options || {})
  649. }
  650. )
  651. }
  652. /** 创建网络搜索厂商 POST /api/ai/web-search/create */
  653. export async function postWebSearchCreate(
  654. body: {
  655. provider: string
  656. name: string
  657. description: string
  658. is_default: boolean
  659. parameters: { proxy_url: string; api_key: string; engine_id: string }
  660. },
  661. options?: { [key: string]: any }
  662. ) {
  663. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  664. '/api/ai/web-search/create',
  665. {
  666. method: 'POST',
  667. headers: {
  668. 'Content-Type': 'application/json'
  669. },
  670. data: body,
  671. ...(options || {})
  672. }
  673. )
  674. }
  675. /** 删除网络搜索厂商 POST /api/ai/web-search/delete */
  676. export async function postWebSearchOpenApiDelete(
  677. body: {
  678. id: string
  679. },
  680. options?: { [key: string]: any }
  681. ) {
  682. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  683. '/api/ai/web-search/delete',
  684. {
  685. method: 'POST',
  686. headers: {
  687. 'Content-Type': 'application/json'
  688. },
  689. data: body,
  690. ...(options || {})
  691. }
  692. )
  693. }
  694. /** 获取支持的引擎列表 POST /api/ai/web-search/engines */
  695. export async function postWebSearchEngines(body: {}, options?: { [key: string]: any }) {
  696. return request<{
  697. isSuccess: boolean
  698. code: number
  699. result: {
  700. description: string
  701. docs_url: string
  702. id: string
  703. name: string
  704. requires_api_key: boolean
  705. requires_engine_id: boolean
  706. supports_proxy: boolean
  707. }[]
  708. isAuthorized: boolean
  709. }>('/api/ai/web-search/engines', {
  710. method: 'POST',
  711. headers: {
  712. 'Content-Type': 'application/json'
  713. },
  714. data: body,
  715. ...(options || {})
  716. })
  717. }
  718. /** 获取详情 POST /api/ai/web-search/info */
  719. export async function postWebSearchInfo(
  720. body: {
  721. id: string
  722. },
  723. options?: { [key: string]: any }
  724. ) {
  725. return request<{
  726. isSuccess: boolean
  727. code: number
  728. result: {
  729. creationTime: string
  730. creatorUserId: string
  731. description: string
  732. id: string
  733. isDeleted: boolean
  734. is_default: boolean
  735. name: string
  736. parameters: { api_key: string }
  737. provider: string
  738. updateTime: string
  739. }
  740. isAuthorized: boolean
  741. }>('/api/ai/web-search/info', {
  742. method: 'POST',
  743. headers: {
  744. 'Content-Type': 'application/json'
  745. },
  746. data: body,
  747. ...(options || {})
  748. })
  749. }
  750. /** 获取分页列表 POST /api/ai/web-search/pageList */
  751. export async function postWebSearchPageList(
  752. body: {
  753. keyword: string
  754. provider: string
  755. pageIndex: number
  756. pageSize?: number
  757. },
  758. options?: { [key: string]: any }
  759. ) {
  760. return request<{
  761. isSuccess: boolean
  762. code: number
  763. result: {
  764. currentPage: number
  765. hasNextPage: boolean
  766. hasPreviousPage: boolean
  767. model: string[]
  768. pageSize: number
  769. totalCount: number
  770. totalPages: number
  771. }
  772. isAuthorized: boolean
  773. }>('/api/ai/web-search/pageList', {
  774. method: 'POST',
  775. headers: {
  776. 'Content-Type': 'application/json'
  777. },
  778. data: body,
  779. ...(options || {})
  780. })
  781. }
  782. /** 获取web搜索选择列表 POST /api/ai/web-search/selectList */
  783. export async function postWebSearchSelectList(
  784. body: {
  785. keyword?: string
  786. },
  787. options?: { [key: string]: any }
  788. ) {
  789. return request<{
  790. isSuccess: boolean
  791. code: number
  792. result: {
  793. currentPage: number
  794. hasNextPage: boolean
  795. hasPreviousPage: boolean
  796. model: string[]
  797. pageSize: number
  798. totalCount: number
  799. totalPages: number
  800. }
  801. isAuthorized: boolean
  802. }>('/api/ai/web-search/selectList', {
  803. method: 'POST',
  804. headers: {
  805. 'Content-Type': 'application/json'
  806. },
  807. data: body,
  808. ...(options || {})
  809. })
  810. }
  811. /** 更新网络搜索厂商 POST /api/ai/web-search/update */
  812. export async function postWebSearchUpdate(
  813. body: {
  814. id: string
  815. name: string
  816. description: string
  817. is_default: boolean
  818. parameters: { proxy_url: string; api_key: string; engine_id: string }
  819. },
  820. options?: { [key: string]: any }
  821. ) {
  822. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  823. '/api/ai/web-search/update',
  824. {
  825. method: 'POST',
  826. headers: {
  827. 'Content-Type': 'application/json'
  828. },
  829. data: body,
  830. ...(options || {})
  831. }
  832. )
  833. }