resource.ts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884
  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: {
  206. currentPage: number
  207. hasNextPage: boolean
  208. hasPreviousPage: boolean
  209. model: {
  210. advanced_config: { retry_count: number; retry_delay: number; timeout: number }
  211. auth_config?: Record<string, any>
  212. creationTime?: string
  213. creatorUserId?: string
  214. description?: string
  215. enabled?: boolean
  216. env_vars?: Record<string, any>
  217. headers?: Record<string, any>
  218. id?: string
  219. isDeleted?: boolean
  220. is_builtin?: boolean
  221. name?: string
  222. stdio_config: { command: string }
  223. transport_type?: string
  224. updateTime?: string
  225. url?: string
  226. }[]
  227. pageSize: number
  228. totalCount: number
  229. totalPages: number
  230. }
  231. isAuthorized: boolean
  232. }>('/api/ai/mcp/selectList', {
  233. method: 'POST',
  234. headers: {
  235. 'Content-Type': 'application/json'
  236. },
  237. data: body,
  238. ...(options || {})
  239. })
  240. }
  241. /** 获取MCP服务工具列表 POST /api/ai/mcp/tools */
  242. export async function postMcpTools(
  243. body: {
  244. id: string
  245. },
  246. options?: { [key: string]: any }
  247. ) {
  248. return request<{
  249. isSuccess: boolean
  250. code: number
  251. result: {
  252. description: string
  253. inputSchema: {
  254. type: string
  255. properties: {
  256. value: { description: string; type: string }
  257. token: { description: string; type: string }
  258. usn: { description: string; type: string }
  259. loginType: { description: string; type: string }
  260. loginWay: { description: string; type: string }
  261. pwd: { description: string; type: string }
  262. }
  263. required: string[]
  264. }
  265. name: string
  266. }[]
  267. isAuthorized: boolean
  268. }>('/api/ai/mcp/tools', {
  269. method: 'POST',
  270. headers: {
  271. 'Content-Type': 'application/json'
  272. },
  273. data: body,
  274. ...(options || {})
  275. })
  276. }
  277. /** 更新MCP POST /api/ai/mcp/update */
  278. export async function postMcpUpdate(
  279. body: {
  280. id: string
  281. name: string
  282. description: string
  283. transport_type: string
  284. url: string
  285. enabled: boolean
  286. headers: Record<string, any>
  287. auth_config: Record<string, any>
  288. advanced_config: { timeout: number; retry_count: number; retry_delay: number }
  289. env_vars: Record<string, any>
  290. },
  291. options?: { [key: string]: any }
  292. ) {
  293. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  294. '/api/ai/mcp/update',
  295. {
  296. method: 'POST',
  297. headers: {
  298. 'Content-Type': 'application/json'
  299. },
  300. data: body,
  301. ...(options || {})
  302. }
  303. )
  304. }
  305. /** 获取系统提示词及模版信息 POST /api/ai/prompt-template/config */
  306. export async function postPromptTemplateConfig(body: {}, options?: { [key: string]: any }) {
  307. return request<{
  308. isSuccess: boolean
  309. code: number
  310. result: {
  311. agent_system_prompts: {
  312. content: string
  313. creationTime: string
  314. default: boolean
  315. description: string
  316. has_knowledge_base: boolean
  317. has_web_search: boolean
  318. id: string
  319. isDeleted: boolean
  320. is_builtin: boolean
  321. mode: string
  322. name: string
  323. type: string
  324. updateTime: string
  325. value: string
  326. }[]
  327. context_templates: {
  328. content: string
  329. creationTime: string
  330. default: boolean
  331. description: string
  332. has_knowledge_base: boolean
  333. has_web_search: boolean
  334. id: string
  335. isDeleted: boolean
  336. is_builtin: boolean
  337. mode: string
  338. name: string
  339. type: string
  340. updateTime: string
  341. value: string
  342. }[]
  343. defaultSystemAgentPrompt: {
  344. content: string
  345. creationTime: string
  346. default: boolean
  347. description: string
  348. has_knowledge_base: boolean
  349. has_web_search: boolean
  350. id: string
  351. isDeleted: boolean
  352. is_builtin: boolean
  353. mode: string
  354. name: string
  355. type: string
  356. updateTime: string
  357. value: string
  358. }
  359. defaultSystemContextTemplate: {
  360. content: string
  361. creationTime: string
  362. default: boolean
  363. description: string
  364. has_knowledge_base: boolean
  365. has_web_search: boolean
  366. id: string
  367. isDeleted: boolean
  368. is_builtin: boolean
  369. mode: string
  370. name: string
  371. type: string
  372. updateTime: string
  373. value: string
  374. }
  375. defaultSystemFallBack: {
  376. content: string
  377. creationTime: string
  378. default: boolean
  379. description: string
  380. has_knowledge_base: boolean
  381. has_web_search: boolean
  382. id: string
  383. isDeleted: boolean
  384. is_builtin: boolean
  385. mode: string
  386. name: string
  387. type: string
  388. updateTime: string
  389. value: string
  390. }
  391. defaultSystemPrompt: {
  392. content: string
  393. creationTime: string
  394. default: boolean
  395. description: string
  396. has_knowledge_base: boolean
  397. has_web_search: boolean
  398. id: string
  399. isDeleted: boolean
  400. is_builtin: boolean
  401. mode: string
  402. name: string
  403. type: string
  404. updateTime: string
  405. value: string
  406. }
  407. defaultSystemRewrite: {
  408. content: string
  409. creationTime: string
  410. default: boolean
  411. description: string
  412. has_knowledge_base: boolean
  413. has_web_search: boolean
  414. id: string
  415. isDeleted: boolean
  416. is_builtin: boolean
  417. mode: string
  418. name: string
  419. type: string
  420. updateTime: string
  421. user: string
  422. value: string
  423. }
  424. fall_backs: {
  425. content: string
  426. creationTime: string
  427. default: boolean
  428. description: string
  429. has_knowledge_base: boolean
  430. has_web_search: boolean
  431. id: string
  432. isDeleted: boolean
  433. is_builtin: boolean
  434. mode: string
  435. name: string
  436. type: string
  437. updateTime: string
  438. value: string
  439. }[]
  440. rewrites: {
  441. content: string
  442. creationTime: string
  443. default: boolean
  444. description: string
  445. has_knowledge_base: boolean
  446. has_web_search: boolean
  447. id: string
  448. isDeleted: boolean
  449. is_builtin: boolean
  450. mode: string
  451. name: string
  452. type: string
  453. updateTime: string
  454. user: string
  455. value: string
  456. }[]
  457. system_prompts: {
  458. content: string
  459. creationTime: string
  460. default: boolean
  461. description: string
  462. has_knowledge_base: boolean
  463. has_web_search: boolean
  464. id: string
  465. isDeleted: boolean
  466. is_builtin: boolean
  467. mode: string
  468. name: string
  469. type: string
  470. updateTime: string
  471. value: string
  472. }[]
  473. }
  474. isAuthorized: boolean
  475. }>('/api/ai/prompt-template/config', {
  476. method: 'POST',
  477. headers: {
  478. 'Content-Type': 'application/json'
  479. },
  480. data: body,
  481. ...(options || {})
  482. })
  483. }
  484. /** 创建提示词与模版 POST /api/ai/prompt-template/create */
  485. export async function postPromptTemplateCreate(
  486. body: {
  487. name: string
  488. description: string
  489. content: string
  490. user: string
  491. type: string
  492. is_default: boolean
  493. has_knowledge_base: boolean
  494. has_web_search: boolean
  495. },
  496. options?: { [key: string]: any }
  497. ) {
  498. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  499. '/api/ai/prompt-template/create',
  500. {
  501. method: 'POST',
  502. headers: {
  503. 'Content-Type': 'application/json'
  504. },
  505. data: body,
  506. ...(options || {})
  507. }
  508. )
  509. }
  510. /** 删除提示词与模版 POST /api/ai/prompt-template/delete */
  511. export async function postPromptTemplateOpenApiDelete(
  512. body: {
  513. id: string
  514. },
  515. options?: { [key: string]: any }
  516. ) {
  517. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  518. '/api/ai/prompt-template/delete',
  519. {
  520. method: 'POST',
  521. headers: {
  522. 'Content-Type': 'application/json'
  523. },
  524. data: body,
  525. ...(options || {})
  526. }
  527. )
  528. }
  529. /** 初始化系统内置提示词和模版 POST /api/ai/prompt-template/initPromptContext */
  530. export async function postPromptTemplateInitPromptContext(
  531. body: {},
  532. options?: { [key: string]: any }
  533. ) {
  534. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  535. '/api/ai/prompt-template/initPromptContext',
  536. {
  537. method: 'POST',
  538. headers: {
  539. 'Content-Type': 'application/json'
  540. },
  541. data: body,
  542. ...(options || {})
  543. }
  544. )
  545. }
  546. /** 获取分页列表 POST /api/ai/prompt-template/pageList */
  547. export async function postPromptTemplatePageList(
  548. body: {
  549. keyword?: string
  550. pageIndex?: number
  551. pageSize?: number
  552. type?: string
  553. },
  554. options?: { [key: string]: any }
  555. ) {
  556. return request<{
  557. isSuccess: boolean
  558. code: number
  559. result: {
  560. currentPage: number
  561. hasNextPage: boolean
  562. hasPreviousPage: boolean
  563. model: {
  564. content: string
  565. creationTime: string
  566. default: boolean
  567. description: string
  568. has_knowledge_base: boolean
  569. has_web_search: boolean
  570. id: string
  571. isDeleted: boolean
  572. is_builtin: boolean
  573. mode: string
  574. name: string
  575. source: string
  576. type: string
  577. updateTime: string
  578. value: string
  579. user: string
  580. }[]
  581. pageSize: number
  582. totalCount: number
  583. totalPages: number
  584. }
  585. isAuthorized: boolean
  586. }>('/api/ai/prompt-template/pageList', {
  587. method: 'POST',
  588. headers: {
  589. 'Content-Type': 'application/json'
  590. },
  591. data: body,
  592. ...(options || {})
  593. })
  594. }
  595. /** 修改提示词与模版 POST /api/ai/prompt-template/update */
  596. export async function postPromptTemplateUpdate(
  597. body: {
  598. id: string
  599. name: string
  600. description: string
  601. content: string
  602. user: string
  603. type: string
  604. is_default: boolean
  605. has_knowledge_base: boolean
  606. has_web_search: boolean
  607. },
  608. options?: { [key: string]: any }
  609. ) {
  610. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  611. '/api/ai/prompt-template/update',
  612. {
  613. method: 'POST',
  614. headers: {
  615. 'Content-Type': 'application/json'
  616. },
  617. data: body,
  618. ...(options || {})
  619. }
  620. )
  621. }
  622. /** 获取支持的Skills列表 POST /api/ai/skills/list */
  623. export async function postSkillsList(body: {}, options?: { [key: string]: any }) {
  624. return request<{
  625. isSuccess: boolean
  626. code: number
  627. result: { description: string; name: string }[]
  628. isAuthorized: boolean
  629. }>('/api/ai/skills/list', {
  630. method: 'POST',
  631. headers: {
  632. 'Content-Type': 'application/json'
  633. },
  634. data: body,
  635. ...(options || {})
  636. })
  637. }
  638. /** 测试已保存的 Provider POST /api/ai/web-search/checkById */
  639. export async function postWebSearchCheckById(
  640. body: {
  641. id: string
  642. },
  643. options?: { [key: string]: any }
  644. ) {
  645. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  646. '/api/ai/web-search/checkById',
  647. {
  648. method: 'POST',
  649. headers: {
  650. 'Content-Type': 'application/json'
  651. },
  652. data: body,
  653. ...(options || {})
  654. }
  655. )
  656. }
  657. /** 使用原始凭证测试连通性 POST /api/ai/web-search/checkWithParameters */
  658. export async function postWebSearchCheckWithParameters(
  659. body: {
  660. provider: string
  661. parameters: { api_key: string; proxy_url: string; engine_id: string }
  662. },
  663. options?: { [key: string]: any }
  664. ) {
  665. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  666. '/api/ai/web-search/checkWithParameters',
  667. {
  668. method: 'POST',
  669. headers: {
  670. 'Content-Type': 'application/json'
  671. },
  672. data: body,
  673. ...(options || {})
  674. }
  675. )
  676. }
  677. /** 创建网络搜索厂商 POST /api/ai/web-search/create */
  678. export async function postWebSearchCreate(
  679. body: {
  680. provider: string
  681. name: string
  682. description: string
  683. is_default: boolean
  684. parameters: { proxy_url: string; api_key: string; engine_id: string }
  685. },
  686. options?: { [key: string]: any }
  687. ) {
  688. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  689. '/api/ai/web-search/create',
  690. {
  691. method: 'POST',
  692. headers: {
  693. 'Content-Type': 'application/json'
  694. },
  695. data: body,
  696. ...(options || {})
  697. }
  698. )
  699. }
  700. /** 删除网络搜索厂商 POST /api/ai/web-search/delete */
  701. export async function postWebSearchOpenApiDelete(
  702. body: {
  703. id: string
  704. },
  705. options?: { [key: string]: any }
  706. ) {
  707. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  708. '/api/ai/web-search/delete',
  709. {
  710. method: 'POST',
  711. headers: {
  712. 'Content-Type': 'application/json'
  713. },
  714. data: body,
  715. ...(options || {})
  716. }
  717. )
  718. }
  719. /** 获取支持的引擎列表 POST /api/ai/web-search/engines */
  720. export async function postWebSearchEngines(body: {}, options?: { [key: string]: any }) {
  721. return request<{
  722. isSuccess: boolean
  723. code: number
  724. result: {
  725. description: string
  726. docs_url: string
  727. id: string
  728. name: string
  729. requires_api_key: boolean
  730. requires_engine_id: boolean
  731. supports_proxy: boolean
  732. }[]
  733. isAuthorized: boolean
  734. }>('/api/ai/web-search/engines', {
  735. method: 'POST',
  736. headers: {
  737. 'Content-Type': 'application/json'
  738. },
  739. data: body,
  740. ...(options || {})
  741. })
  742. }
  743. /** 获取详情 POST /api/ai/web-search/info */
  744. export async function postWebSearchInfo(
  745. body: {
  746. id: string
  747. },
  748. options?: { [key: string]: any }
  749. ) {
  750. return request<{
  751. isSuccess: boolean
  752. code: number
  753. result: {
  754. creationTime: string
  755. creatorUserId: string
  756. description: string
  757. id: string
  758. isDeleted: boolean
  759. is_default: boolean
  760. name: string
  761. parameters: { api_key: string }
  762. provider: string
  763. updateTime: string
  764. }
  765. isAuthorized: boolean
  766. }>('/api/ai/web-search/info', {
  767. method: 'POST',
  768. headers: {
  769. 'Content-Type': 'application/json'
  770. },
  771. data: body,
  772. ...(options || {})
  773. })
  774. }
  775. /** 获取分页列表 POST /api/ai/web-search/pageList */
  776. export async function postWebSearchPageList(
  777. body: {
  778. keyword: string
  779. provider: string
  780. pageIndex: number
  781. pageSize?: number
  782. },
  783. options?: { [key: string]: any }
  784. ) {
  785. return request<{
  786. isSuccess: boolean
  787. code: number
  788. result: {
  789. currentPage: number
  790. hasNextPage: boolean
  791. hasPreviousPage: boolean
  792. model: string[]
  793. pageSize: number
  794. totalCount: number
  795. totalPages: number
  796. }
  797. isAuthorized: boolean
  798. }>('/api/ai/web-search/pageList', {
  799. method: 'POST',
  800. headers: {
  801. 'Content-Type': 'application/json'
  802. },
  803. data: body,
  804. ...(options || {})
  805. })
  806. }
  807. /** 获取web搜索选择列表 POST /api/ai/web-search/selectList */
  808. export async function postWebSearchSelectList(
  809. body: {
  810. keyword?: string
  811. },
  812. options?: { [key: string]: any }
  813. ) {
  814. return request<{
  815. isSuccess: boolean
  816. code: number
  817. result: {
  818. currentPage: number
  819. hasNextPage: boolean
  820. hasPreviousPage: boolean
  821. model: string[]
  822. pageSize: number
  823. totalCount: number
  824. totalPages: number
  825. }
  826. isAuthorized: boolean
  827. }>('/api/ai/web-search/selectList', {
  828. method: 'POST',
  829. headers: {
  830. 'Content-Type': 'application/json'
  831. },
  832. data: body,
  833. ...(options || {})
  834. })
  835. }
  836. /** 更新网络搜索厂商 POST /api/ai/web-search/update */
  837. export async function postWebSearchUpdate(
  838. body: {
  839. id: string
  840. name: string
  841. description: string
  842. is_default: boolean
  843. parameters: { proxy_url: string; api_key: string; engine_id: string }
  844. },
  845. options?: { [key: string]: any }
  846. ) {
  847. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  848. '/api/ai/web-search/update',
  849. {
  850. method: 'POST',
  851. headers: {
  852. 'Content-Type': 'application/json'
  853. },
  854. data: body,
  855. ...(options || {})
  856. }
  857. )
  858. }