docx_functions.json 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167
  1. [
  2. {
  3. "name": "add_paragraph_to_docx",
  4. "description": "向Word文档添加段落",
  5. "parameters": {
  6. "type": "object",
  7. "properties": {
  8. "text": {
  9. "type": "string",
  10. "description": "段落内容"
  11. }
  12. },
  13. "required": ["text"]
  14. }
  15. },
  16. {
  17. "name": "create_new_document",
  18. "description": "创建一个新的Word文档",
  19. "parameters": {
  20. "type": "object",
  21. "properties": {},
  22. "required": []
  23. }
  24. },
  25. {
  26. "name": "save_document",
  27. "description": "保存Word文档",
  28. "parameters": {
  29. "type": "object",
  30. "properties": {
  31. "file_path": {
  32. "type": "string",
  33. "description": "文档保存路径"
  34. }
  35. },
  36. "required": ["file_path"]
  37. }
  38. },
  39. {
  40. "name": "set_global_font",
  41. "description": "设置文档的全局字体",
  42. "parameters": {
  43. "type": "object",
  44. "properties": {
  45. "font_name": {
  46. "type": "string",
  47. "description": "字体名称"
  48. },
  49. "font_size": {
  50. "type": "number",
  51. "description": "字体大小(磅)"
  52. },
  53. "font_color": {
  54. "type": "string",
  55. "description": "字体颜色(RGB格式,如'FF0000'表示红色)"
  56. }
  57. }
  58. }
  59. },
  60. {
  61. "name": "open_document",
  62. "description": "打开现有的Word文档",
  63. "parameters": {
  64. "type": "object",
  65. "properties": {
  66. "file_path": {
  67. "type": "string",
  68. "description": "文档路径"
  69. }
  70. },
  71. "required": ["file_path"]
  72. }
  73. },
  74. {
  75. "name": "add_heading",
  76. "description": "添加标题",
  77. "parameters": {
  78. "type": "object",
  79. "properties": {
  80. "text": {
  81. "type": "string",
  82. "description": "标题文本"
  83. },
  84. "level": {
  85. "type": "integer",
  86. "description": "标题级别(1-9)",
  87. "default": 1
  88. }
  89. },
  90. "required": ["text"]
  91. }
  92. },
  93. {
  94. "name": "add_table",
  95. "description": "添加表格",
  96. "parameters": {
  97. "type": "object",
  98. "properties": {
  99. "rows": {
  100. "type": "integer",
  101. "description": "表格行数"
  102. },
  103. "cols": {
  104. "type": "integer",
  105. "description": "表格列数"
  106. },
  107. "data": {
  108. "type": "array",
  109. "description": "表格数据,二维数组,每个元素代表一个单元格的内容",
  110. "items": {
  111. "type": "array",
  112. "items": {
  113. "type": "string"
  114. }
  115. }
  116. }
  117. },
  118. "required": ["rows", "cols"]
  119. }
  120. },
  121. {
  122. "name": "add_picture",
  123. "description": "添加图片",
  124. "parameters": {
  125. "type": "object",
  126. "properties": {
  127. "image_path": {
  128. "type": "string",
  129. "description": "图片文件路径"
  130. },
  131. "width": {
  132. "type": "number",
  133. "description": "图片宽度(厘米)"
  134. },
  135. "height": {
  136. "type": "number",
  137. "description": "图片高度(厘米)"
  138. }
  139. },
  140. "required": ["image_path"]
  141. }
  142. },
  143. {
  144. "name": "add_page_break",
  145. "description": "添加分页符",
  146. "parameters": {
  147. "type": "object",
  148. "properties": {},
  149. "required": []
  150. }
  151. },
  152. {
  153. "name": "set_paragraph_style",
  154. "description": "设置段落样式",
  155. "parameters": {
  156. "type": "object",
  157. "properties": {
  158. "paragraph_index": {
  159. "type": "integer",
  160. "description": "段落索引"
  161. },
  162. "style_name": {
  163. "type": "string",
  164. "description": "样式名称"
  165. }
  166. },
  167. "required": ["paragraph_index", "style_name"]
  168. }
  169. },
  170. {
  171. "name": "set_font",
  172. "description": "设置文本字体",
  173. "parameters": {
  174. "type": "object",
  175. "properties": {
  176. "paragraph_index": {
  177. "type": "integer",
  178. "description": "段落索引"
  179. },
  180. "run_index": {
  181. "type": "integer",
  182. "description": "文本运行索引"
  183. },
  184. "font_name": {
  185. "type": "string",
  186. "description": "字体名称"
  187. },
  188. "font_size": {
  189. "type": "integer",
  190. "description": "字体大小"
  191. },
  192. "bold": {
  193. "type": "boolean",
  194. "description": "是否加粗"
  195. },
  196. "italic": {
  197. "type": "boolean",
  198. "description": "是否斜体"
  199. },
  200. "underline": {
  201. "type": "boolean",
  202. "description": "是否下划线"
  203. },
  204. "color": {
  205. "type": "string",
  206. "description": "字体颜色,如'FF0000'表示红色"
  207. }
  208. },
  209. "required": ["paragraph_index", "run_index"]
  210. }
  211. },
  212. {
  213. "name": "set_paragraph_alignment",
  214. "description": "设置段落对齐方式",
  215. "parameters": {
  216. "type": "object",
  217. "properties": {
  218. "paragraph_index": {
  219. "type": "integer",
  220. "description": "段落索引"
  221. },
  222. "alignment": {
  223. "type": "string",
  224. "description": "对齐方式:LEFT, CENTER, RIGHT, JUSTIFY",
  225. "enum": ["LEFT", "CENTER", "RIGHT", "JUSTIFY"]
  226. }
  227. },
  228. "required": ["paragraph_index", "alignment"]
  229. }
  230. },
  231. {
  232. "name": "set_paragraph_spacing",
  233. "description": "设置段落间距",
  234. "parameters": {
  235. "type": "object",
  236. "properties": {
  237. "paragraph_index": {
  238. "type": "integer",
  239. "description": "段落索引"
  240. },
  241. "before": {
  242. "type": "integer",
  243. "description": "段前间距(磅)"
  244. },
  245. "after": {
  246. "type": "integer",
  247. "description": "段后间距(磅)"
  248. },
  249. "line_spacing": {
  250. "type": "number",
  251. "description": "行间距(倍数)"
  252. }
  253. },
  254. "required": ["paragraph_index"]
  255. }
  256. },
  257. {
  258. "name": "add_section",
  259. "description": "添加新的节",
  260. "parameters": {
  261. "type": "object",
  262. "properties": {
  263. "start_type": {
  264. "type": "string",
  265. "description": "节的开始类型:NEW_PAGE, EVEN_PAGE, ODD_PAGE, CONTINUOUS",
  266. "enum": ["NEW_PAGE", "EVEN_PAGE", "ODD_PAGE", "CONTINUOUS"]
  267. }
  268. },
  269. "required": []
  270. }
  271. },
  272. {
  273. "name": "set_section_orientation",
  274. "description": "设置节的页面方向",
  275. "parameters": {
  276. "type": "object",
  277. "properties": {
  278. "section_index": {
  279. "type": "integer",
  280. "description": "节索引"
  281. },
  282. "orientation": {
  283. "type": "string",
  284. "description": "页面方向:PORTRAIT, LANDSCAPE",
  285. "enum": ["PORTRAIT", "LANDSCAPE"]
  286. }
  287. },
  288. "required": ["section_index", "orientation"]
  289. }
  290. },
  291. {
  292. "name": "set_section_page_size",
  293. "description": "设置节的页面大小",
  294. "parameters": {
  295. "type": "object",
  296. "properties": {
  297. "section_index": {
  298. "type": "integer",
  299. "description": "节索引"
  300. },
  301. "width": {
  302. "type": "number",
  303. "description": "页面宽度(厘米)"
  304. },
  305. "height": {
  306. "type": "number",
  307. "description": "页面高度(厘米)"
  308. }
  309. },
  310. "required": ["section_index", "width", "height"]
  311. }
  312. },
  313. {
  314. "name": "set_section_margins",
  315. "description": "设置节的页边距",
  316. "parameters": {
  317. "type": "object",
  318. "properties": {
  319. "section_index": {
  320. "type": "integer",
  321. "description": "节索引"
  322. },
  323. "top": {
  324. "type": "number",
  325. "description": "上边距(厘米)"
  326. },
  327. "right": {
  328. "type": "number",
  329. "description": "右边距(厘米)"
  330. },
  331. "bottom": {
  332. "type": "number",
  333. "description": "下边距(厘米)"
  334. },
  335. "left": {
  336. "type": "number",
  337. "description": "左边距(厘米)"
  338. }
  339. },
  340. "required": ["section_index"]
  341. }
  342. },
  343. {
  344. "name": "add_header",
  345. "description": "添加页眉",
  346. "parameters": {
  347. "type": "object",
  348. "properties": {
  349. "section_index": {
  350. "type": "integer",
  351. "description": "节索引"
  352. },
  353. "text": {
  354. "type": "string",
  355. "description": "页眉文本"
  356. }
  357. },
  358. "required": ["section_index", "text"]
  359. }
  360. },
  361. {
  362. "name": "add_footer",
  363. "description": "添加页脚",
  364. "parameters": {
  365. "type": "object",
  366. "properties": {
  367. "section_index": {
  368. "type": "integer",
  369. "description": "节索引"
  370. },
  371. "text": {
  372. "type": "string",
  373. "description": "页脚文本"
  374. }
  375. },
  376. "required": ["section_index", "text"]
  377. }
  378. },
  379. {
  380. "name": "add_page_number",
  381. "description": "添加页码",
  382. "parameters": {
  383. "type": "object",
  384. "properties": {
  385. "section_index": {
  386. "type": "integer",
  387. "description": "节索引"
  388. },
  389. "position": {
  390. "type": "string",
  391. "description": "页码位置:HEADER, FOOTER",
  392. "enum": ["HEADER", "FOOTER"]
  393. },
  394. "alignment": {
  395. "type": "string",
  396. "description": "页码对齐方式:LEFT, CENTER, RIGHT",
  397. "enum": ["LEFT", "CENTER", "RIGHT"]
  398. },
  399. "format": {
  400. "type": "string",
  401. "description": "页码格式:如'第 {0} 页',其中{0}将被替换为页码"
  402. }
  403. },
  404. "required": ["section_index", "position"]
  405. }
  406. },
  407. {
  408. "name": "merge_table_cells",
  409. "description": "合并表格单元格",
  410. "parameters": {
  411. "type": "object",
  412. "properties": {
  413. "table_index": {
  414. "type": "integer",
  415. "description": "表格索引"
  416. },
  417. "start_row": {
  418. "type": "integer",
  419. "description": "起始行索引"
  420. },
  421. "start_col": {
  422. "type": "integer",
  423. "description": "起始列索引"
  424. },
  425. "end_row": {
  426. "type": "integer",
  427. "description": "结束行索引"
  428. },
  429. "end_col": {
  430. "type": "integer",
  431. "description": "结束列索引"
  432. }
  433. },
  434. "required": ["table_index", "start_row", "start_col", "end_row", "end_col"]
  435. }
  436. },
  437. {
  438. "name": "set_table_cell_text",
  439. "description": "设置表格单元格文本",
  440. "parameters": {
  441. "type": "object",
  442. "properties": {
  443. "table_index": {
  444. "type": "integer",
  445. "description": "表格索引"
  446. },
  447. "row": {
  448. "type": "integer",
  449. "description": "行索引"
  450. },
  451. "col": {
  452. "type": "integer",
  453. "description": "列索引"
  454. },
  455. "text": {
  456. "type": "string",
  457. "description": "单元格文本"
  458. }
  459. },
  460. "required": ["table_index", "row", "col", "text"]
  461. }
  462. },
  463. {
  464. "name": "set_table_style",
  465. "description": "设置表格样式",
  466. "parameters": {
  467. "type": "object",
  468. "properties": {
  469. "table_index": {
  470. "type": "integer",
  471. "description": "表格索引"
  472. },
  473. "style_name": {
  474. "type": "string",
  475. "description": "样式名称"
  476. }
  477. },
  478. "required": ["table_index", "style_name"]
  479. }
  480. },
  481. {
  482. "name": "set_table_cell_background",
  483. "description": "设置表格单元格背景色",
  484. "parameters": {
  485. "type": "object",
  486. "properties": {
  487. "table_index": {
  488. "type": "integer",
  489. "description": "表格索引"
  490. },
  491. "row": {
  492. "type": "integer",
  493. "description": "行索引"
  494. },
  495. "col": {
  496. "type": "integer",
  497. "description": "列索引"
  498. },
  499. "color": {
  500. "type": "string",
  501. "description": "背景颜色,如'FF0000'表示红色"
  502. }
  503. },
  504. "required": ["table_index", "row", "col", "color"]
  505. }
  506. },
  507. {
  508. "name": "set_table_cell_vertical_alignment",
  509. "description": "设置表格单元格垂直对齐方式",
  510. "parameters": {
  511. "type": "object",
  512. "properties": {
  513. "table_index": {
  514. "type": "integer",
  515. "description": "表格索引"
  516. },
  517. "row": {
  518. "type": "integer",
  519. "description": "行索引"
  520. },
  521. "col": {
  522. "type": "integer",
  523. "description": "列索引"
  524. },
  525. "alignment": {
  526. "type": "string",
  527. "description": "垂直对齐方式:TOP, CENTER, BOTTOM",
  528. "enum": ["TOP", "CENTER", "BOTTOM"]
  529. }
  530. },
  531. "required": ["table_index", "row", "col", "alignment"]
  532. }
  533. },
  534. {
  535. "name": "set_table_width",
  536. "description": "设置表格宽度",
  537. "parameters": {
  538. "type": "object",
  539. "properties": {
  540. "table_index": {
  541. "type": "integer",
  542. "description": "表格索引"
  543. },
  544. "width": {
  545. "type": "number",
  546. "description": "表格宽度(厘米)"
  547. }
  548. },
  549. "required": ["table_index", "width"]
  550. }
  551. },
  552. {
  553. "name": "set_table_column_width",
  554. "description": "设置表格列宽",
  555. "parameters": {
  556. "type": "object",
  557. "properties": {
  558. "table_index": {
  559. "type": "integer",
  560. "description": "表格索引"
  561. },
  562. "col": {
  563. "type": "integer",
  564. "description": "列索引"
  565. },
  566. "width": {
  567. "type": "number",
  568. "description": "列宽(厘米)"
  569. }
  570. },
  571. "required": ["table_index", "col", "width"]
  572. }
  573. },
  574. {
  575. "name": "add_hyperlink",
  576. "description": "添加超链接",
  577. "parameters": {
  578. "type": "object",
  579. "properties": {
  580. "paragraph_index": {
  581. "type": "integer",
  582. "description": "段落索引"
  583. },
  584. "text": {
  585. "type": "string",
  586. "description": "链接文本"
  587. },
  588. "url": {
  589. "type": "string",
  590. "description": "链接URL"
  591. }
  592. },
  593. "required": ["paragraph_index", "text", "url"]
  594. }
  595. },
  596. {
  597. "name": "add_bookmark",
  598. "description": "添加书签",
  599. "parameters": {
  600. "type": "object",
  601. "properties": {
  602. "paragraph_index": {
  603. "type": "integer",
  604. "description": "段落索引"
  605. },
  606. "bookmark_name": {
  607. "type": "string",
  608. "description": "书签名称"
  609. },
  610. "text": {
  611. "type": "string",
  612. "description": "书签文本"
  613. }
  614. },
  615. "required": ["paragraph_index", "bookmark_name", "text"]
  616. }
  617. },
  618. {
  619. "name": "add_table_of_contents",
  620. "description": "添加目录",
  621. "parameters": {
  622. "type": "object",
  623. "properties": {
  624. "title": {
  625. "type": "string",
  626. "description": "目录标题"
  627. },
  628. "levels": {
  629. "type": "integer",
  630. "description": "包含的标题级别数",
  631. "default": 3
  632. }
  633. },
  634. "required": ["title"]
  635. }
  636. },
  637. {
  638. "name": "set_table_borders",
  639. "description": "设置表格边框样式",
  640. "parameters": {
  641. "type": "object",
  642. "properties": {
  643. "table_index": {
  644. "type": "integer",
  645. "description": "表格索引"
  646. },
  647. "border_style": {
  648. "type": "string",
  649. "description": "边框样式,可选值: 'single', 'thick', 'double', 'dotted', 'dashed', 'none'",
  650. "enum": ["single", "thick", "double", "dotted", "dashed", "none"],
  651. "default": "single"
  652. },
  653. "border_width": {
  654. "type": "number",
  655. "description": "边框宽度,单位为磅",
  656. "default": 1
  657. },
  658. "border_color": {
  659. "type": "string",
  660. "description": "边框颜色,十六进制RGB值,如'000000'表示黑色",
  661. "default": "000000"
  662. },
  663. "apply_to": {
  664. "type": "string",
  665. "description": "应用边框的位置,可选值: 'all', 'outside', 'inside', 'top', 'bottom', 'left', 'right'",
  666. "enum": ["all", "outside", "inside", "top", "bottom", "left", "right"],
  667. "default": "all"
  668. },
  669. "first_row": {
  670. "type": "boolean",
  671. "description": "是否为第一行应用特殊边框",
  672. "default": false
  673. },
  674. "first_column": {
  675. "type": "boolean",
  676. "description": "是否为第一列应用特殊边框",
  677. "default": false
  678. },
  679. "last_row": {
  680. "type": "boolean",
  681. "description": "是否为最后一行应用特殊边框",
  682. "default": false
  683. },
  684. "last_column": {
  685. "type": "boolean",
  686. "description": "是否为最后一列应用特殊边框",
  687. "default": false
  688. }
  689. },
  690. "required": ["table_index"]
  691. }
  692. },
  693. {
  694. "name": "set_cell_borders",
  695. "description": "设置单元格边框样式",
  696. "parameters": {
  697. "type": "object",
  698. "properties": {
  699. "table_index": {
  700. "type": "integer",
  701. "description": "表格索引"
  702. },
  703. "row": {
  704. "type": "integer",
  705. "description": "行索引"
  706. },
  707. "col": {
  708. "type": "integer",
  709. "description": "列索引"
  710. },
  711. "border_style": {
  712. "type": "string",
  713. "description": "边框样式,可选值: 'single', 'thick', 'double', 'dotted', 'dashed', 'none'",
  714. "enum": ["single", "thick", "double", "dotted", "dashed", "none"],
  715. "default": "single"
  716. },
  717. "border_width": {
  718. "type": "number",
  719. "description": "边框宽度,单位为磅",
  720. "default": 1
  721. },
  722. "border_color": {
  723. "type": "string",
  724. "description": "边框颜色,十六进制RGB值,如'000000'表示黑色",
  725. "default": "000000"
  726. },
  727. "apply_to": {
  728. "type": "string",
  729. "description": "应用边框的位置,可选值: 'all', 'top', 'bottom', 'left', 'right'",
  730. "enum": ["all", "top", "bottom", "left", "right"],
  731. "default": "all"
  732. }
  733. },
  734. "required": ["table_index", "row", "col"]
  735. }
  736. },
  737. {
  738. "name": "add_table_standard_borders",
  739. "description": "为表格添加标准边框(所有单元格都有边框)",
  740. "parameters": {
  741. "type": "object",
  742. "properties": {
  743. "table_index": {
  744. "type": "integer",
  745. "description": "表格索引"
  746. }
  747. },
  748. "required": ["table_index"]
  749. }
  750. },
  751. {
  752. "name": "copy_excel_to_word",
  753. "description": "将Excel表格复制到Word文档",
  754. "parameters": {
  755. "type": "object",
  756. "properties": {
  757. "excel_path": {
  758. "type": "string",
  759. "description": "Excel文件路径"
  760. },
  761. "word_path": {
  762. "type": "string",
  763. "description": "Word文件路径,如果为null则创建新文档"
  764. },
  765. "sheet_name": {
  766. "type": "string",
  767. "description": "要复制的工作表名称,如果为null则复制第一个工作表"
  768. },
  769. "output_path": {
  770. "type": "string",
  771. "description": "输出Word文件路径,如果为null则覆盖原文件"
  772. }
  773. },
  774. "required": ["excel_path"]
  775. }
  776. },
  777. {
  778. "name": "copy_excel_range_to_word",
  779. "description": "将Excel表格的指定区域复制到Word文档",
  780. "parameters": {
  781. "type": "object",
  782. "properties": {
  783. "excel_path": {
  784. "type": "string",
  785. "description": "Excel文件路径"
  786. },
  787. "word_path": {
  788. "type": "string",
  789. "description": "Word文件路径,如果为null则创建新文档"
  790. },
  791. "sheet_name": {
  792. "type": "string",
  793. "description": "要复制的工作表名称"
  794. },
  795. "range_str": {
  796. "type": "string",
  797. "description": "要复制的单元格区域,如'A1:C5'"
  798. },
  799. "output_path": {
  800. "type": "string",
  801. "description": "输出Word文件路径,如果为null则覆盖原文件"
  802. }
  803. },
  804. "required": ["excel_path", "sheet_name", "range_str"]
  805. }
  806. },
  807. {
  808. "name": "add_table_row",
  809. "description": "在Word文档中的表格添加一行",
  810. "parameters": {
  811. "type": "object",
  812. "properties": {
  813. "table_index": {
  814. "type": "integer",
  815. "description": "表格索引,默认为第一个表格",
  816. "default": 0
  817. },
  818. "position": {
  819. "type": "integer",
  820. "description": "要插入行的位置,如果为null则添加到表格末尾"
  821. }
  822. },
  823. "required": ["table_index", "position"]
  824. }
  825. },
  826. {
  827. "name": "add_table_column",
  828. "description": "在Word文档中的表格添加一列",
  829. "parameters": {
  830. "type": "object",
  831. "properties": {
  832. "table_index": {
  833. "type": "integer",
  834. "description": "表格索引,默认为第一个表格",
  835. "default": 0
  836. },
  837. "position": {
  838. "type": "integer",
  839. "description": "要插入列的位置,如果为null则添加到表格末尾"
  840. }
  841. },
  842. "required": ["table_index", "position"]
  843. }
  844. },
  845. {
  846. "name": "delete_table_row",
  847. "description": "删除Word文档中表格的一行",
  848. "parameters": {
  849. "type": "object",
  850. "properties": {
  851. "table_index": {
  852. "type": "integer",
  853. "description": "表格索引,默认为第一个表格",
  854. "default": 0
  855. },
  856. "row_index": {
  857. "type": "integer",
  858. "description": "要删除的行索引"
  859. }
  860. },
  861. "required": ["table_index", "row_index"]
  862. }
  863. },
  864. {
  865. "name": "delete_table_column",
  866. "description": "删除Word文档中表格的一列",
  867. "parameters": {
  868. "type": "object",
  869. "properties": {
  870. "table_index": {
  871. "type": "integer",
  872. "description": "表格索引,默认为第一个表格",
  873. "default": 0
  874. },
  875. "column_index": {
  876. "type": "integer",
  877. "description": "要删除的列索引"
  878. }
  879. },
  880. "required": ["table_index", "column_index"]
  881. }
  882. },
  883. {
  884. "name": "get_table_dimensions",
  885. "description": "获取表格的维度(行数和列数)",
  886. "parameters": {
  887. "type": "object",
  888. "properties": {
  889. "table_index": {
  890. "type": "integer",
  891. "description": "表格索引,默认为第一个表格",
  892. "default": 0
  893. }
  894. },
  895. "required": ["table_index"]
  896. }
  897. },
  898. {
  899. "name": "get_table_cell_text",
  900. "description": "获取表格单元格的文本内容",
  901. "parameters": {
  902. "type": "object",
  903. "properties": {
  904. "table_index": {
  905. "type": "integer",
  906. "description": "表格索引,默认为第一个表格",
  907. "default": 0
  908. },
  909. "row": {
  910. "type": "integer",
  911. "description": "行索引",
  912. "default": 0
  913. },
  914. "col": {
  915. "type": "integer",
  916. "description": "列索引",
  917. "default": 0
  918. }
  919. },
  920. "required": ["table_index", "row", "col"]
  921. }
  922. },
  923. {
  924. "name": "get_table_row",
  925. "description": "获取表格中一行的所有单元格文本",
  926. "parameters": {
  927. "type": "object",
  928. "properties": {
  929. "table_index": {
  930. "type": "integer",
  931. "description": "表格索引,默认为第一个表格",
  932. "default": 0
  933. },
  934. "row": {
  935. "type": "integer",
  936. "description": "行索引",
  937. "default": 0
  938. }
  939. },
  940. "required": ["table_index", "row"]
  941. }
  942. },
  943. {
  944. "name": "get_table_column",
  945. "description": "获取表格中一列的所有单元格文本",
  946. "parameters": {
  947. "type": "object",
  948. "properties": {
  949. "table_index": {
  950. "type": "integer",
  951. "description": "表格索引,默认为第一个表格",
  952. "default": 0
  953. },
  954. "col": {
  955. "type": "integer",
  956. "description": "列索引",
  957. "default": 0
  958. }
  959. },
  960. "required": ["table_index", "col"]
  961. }
  962. },
  963. {
  964. "name": "get_table_range",
  965. "description": "获取表格中指定范围的单元格文本",
  966. "parameters": {
  967. "type": "object",
  968. "properties": {
  969. "table_index": {
  970. "type": "integer",
  971. "description": "表格索引,默认为第一个表格",
  972. "default": 0
  973. },
  974. "start_row": {
  975. "type": "integer",
  976. "description": "起始行索引",
  977. "default": 0
  978. },
  979. "start_col": {
  980. "type": "integer",
  981. "description": "起始列索引",
  982. "default": 0
  983. },
  984. "end_row": {
  985. "type": "integer",
  986. "description": "结束行索引,如果为null则取最后一行"
  987. },
  988. "end_col": {
  989. "type": "integer",
  990. "description": "结束列索引,如果为null则取最后一列"
  991. }
  992. },
  993. "required": ["table_index", "start_row", "start_col"]
  994. }
  995. },
  996. {
  997. "name": "get_all_tables_info",
  998. "description": "获取文档中所有表格的基本信息",
  999. "parameters": {
  1000. "type": "object",
  1001. "properties": {}
  1002. },
  1003. "required": []
  1004. },
  1005. {
  1006. "name": "set_table_data",
  1007. "description": "批量设置表格数据",
  1008. "parameters": {
  1009. "type": "object",
  1010. "properties": {
  1011. "table_index": {
  1012. "type": "integer",
  1013. "description": "表格索引,默认为第一个表格",
  1014. "default": 0
  1015. },
  1016. "data": {
  1017. "type": "array",
  1018. "description": "二维数组数据,如[[1,2,3],[4,5,6]]",
  1019. "items": {
  1020. "type": "array",
  1021. "items": {
  1022. "type": "string"
  1023. }
  1024. }
  1025. },
  1026. "start_row": {
  1027. "type": "integer",
  1028. "description": "起始行索引",
  1029. "default": 0
  1030. },
  1031. "start_col": {
  1032. "type": "integer",
  1033. "description": "起始列索引",
  1034. "default": 0
  1035. },
  1036. "clear_existing": {
  1037. "type": "boolean",
  1038. "description": "是否清除现有内容",
  1039. "default": false
  1040. }
  1041. },
  1042. "required": ["table_index", "data", "start_row", "start_col", "clear_existing"]
  1043. }
  1044. },
  1045. {
  1046. "name": "set_table_row_data",
  1047. "description": "设置表格一行的数据",
  1048. "parameters": {
  1049. "type": "object",
  1050. "properties": {
  1051. "table_index": {
  1052. "type": "integer",
  1053. "description": "表格索引,默认为第一个表格",
  1054. "default": 0
  1055. },
  1056. "row": {
  1057. "type": "integer",
  1058. "description": "行索引",
  1059. "default": 0
  1060. },
  1061. "data": {
  1062. "type": "array",
  1063. "description": "一维数组数据,如[1,2,3]",
  1064. "items": {
  1065. "type": "string"
  1066. }
  1067. },
  1068. "start_col": {
  1069. "type": "integer",
  1070. "description": "起始列索引",
  1071. "default": 0
  1072. },
  1073. "clear_existing": {
  1074. "type": "boolean",
  1075. "description": "是否清除现有内容",
  1076. "default": false
  1077. }
  1078. },
  1079. "required": ["table_index", "row", "data", "start_col", "clear_existing"]
  1080. }
  1081. },
  1082. {
  1083. "name": "set_table_column_data",
  1084. "description": "设置表格一列的数据",
  1085. "parameters": {
  1086. "type": "object",
  1087. "properties": {
  1088. "table_index": {
  1089. "type": "integer",
  1090. "description": "表格索引,默认为第一个表格",
  1091. "default": 0
  1092. },
  1093. "col": {
  1094. "type": "integer",
  1095. "description": "列索引",
  1096. "default": 0
  1097. },
  1098. "data": {
  1099. "type": "array",
  1100. "description": "一维数组数据,如[1,2,3]",
  1101. "items": {
  1102. "type": "string"
  1103. }
  1104. },
  1105. "start_row": {
  1106. "type": "integer",
  1107. "description": "起始行索引",
  1108. "default": 0
  1109. },
  1110. "clear_existing": {
  1111. "type": "boolean",
  1112. "description": "是否清除现有内容",
  1113. "default": false
  1114. }
  1115. },
  1116. "required": ["table_index", "col", "data", "start_row", "clear_existing"]
  1117. }
  1118. },
  1119. {
  1120. "name": "clear_table_range",
  1121. "description": "清除表格中指定范围的内容",
  1122. "parameters": {
  1123. "type": "object",
  1124. "properties": {
  1125. "table_index": {
  1126. "type": "integer",
  1127. "description": "表格索引,默认为第一个表格",
  1128. "default": 0
  1129. },
  1130. "start_row": {
  1131. "type": "integer",
  1132. "description": "起始行索引",
  1133. "default": 0
  1134. },
  1135. "start_col": {
  1136. "type": "integer",
  1137. "description": "起始列索引",
  1138. "default": 0
  1139. },
  1140. "end_row": {
  1141. "type": "integer",
  1142. "description": "结束行索引,如果为null则取最后一行"
  1143. },
  1144. "end_col": {
  1145. "type": "integer",
  1146. "description": "结束列索引,如果为null则取最后一列"
  1147. }
  1148. },
  1149. "required": ["table_index", "start_row", "start_col", "end_row", "end_col"]
  1150. }
  1151. },
  1152. {
  1153. "name": "get_table_detail_by_id",
  1154. "description": "获取表格的详细信息,包括所有单元格的内容和基本格式",
  1155. "parameters": {
  1156. "type": "object",
  1157. "properties": {
  1158. "table_index": {
  1159. "type": "integer",
  1160. "description": "表格索引,默认为第一个表格",
  1161. "default": 0
  1162. }
  1163. },
  1164. "required": ["table_index"]
  1165. }
  1166. }
  1167. ]