mirrored 16 minutes ago
0
Adam Yanxiao ZhaoAdd AutoGLM-OS agent (#309) * autoglm-os initialize * clean code * chore: use proxy for download setup * feat(autoglm-os): add parameter to toggle images * fix: use temporary directory for files pulled from the vm to prevent potential collision when running multiple instances of the same task in parallel * update * add client_password * update multienv * fix * fix prompt * fix prompt * fix prompt * fix sys prompt * feat: use proxy in file evaluator * fix client_password * fix note_prompt * fix autoglm agent cmd type * fix * revert: fix: use temporary directory for files pulled from the vm to prevent potential collision when running multiple instances of the same task in parallel reverts commit bab5473eea1de0e61b0e1d68b23ce324a5b0ee57 * feat(autoglm): setup tools * fix(autoglm): remove second time of get a11y tree * add osworld server restart * Revert "add osworld server restart" This reverts commit 7bd9d84122e246ce2a26de0e49c25494244c2b3d. * fix _launch_setup * fix autoglm agent tools & xml tree * fix desktop_env * fix bug for tool name capitalization * fix: always use proxy for setup download * add fail after exceeding max turns * fix(autoglm): avoid adding image to message when screenshot is empty * fix maximize_window * fix maximize_window * fix maximize_window * fix import browsertools module bug * fix task proxy config bug * restore setup * refactor desktop env * restore image in provider * restore file.py * refactor desktop_env * quick fix * refactor desktop_env.step * fix our env reset * add max truns constraint * clean run script * clean lib_run_single.py --------- Co-authored-by: hanyullai <hanyullai@outlook.com> Co-authored-by: JingBh <jingbohao@yeah.net>aa05f6c
[
  {
    "type": "function",
    "function": {
      "name": "WriterTools.save",
      "description": "Save the current document to its current location",
      "parameters": {
        "type": "object",
        "properties": {},
        "required": []
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.write_text",
      "description": "Write text at the current cursor position in the document.",
      "parameters": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "The text to write at the current cursor position."
          },
          "bold": {
            "type": "boolean",
            "description": "Optional. Whether to write the text in bold."
          },
          "italic": {
            "type": "boolean",
            "description": "Optional. Whether to write the text in italic."
          },
          "size": {
            "type": "number",
            "description": "Optional. The size of the text."
          }
        },
        "required": ["text"]
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.set_color",
      "description": "Changes the color of matched text in the document for specified paragraphs.",
      "parameters": {
        "type": "object",
        "properties": {
          "pattern": {
            "type": "string",
            "description": "The pattern to match in the document, should be a regular expression"
          },
          "color": {
            "type": "number",
            "description": "The color to apply, should be a hex color code, like 0x000000 for black"
          },
          "paragraph_indices": {
            "type": "array",
            "description": "Optional. Indices of paragraphs to modify (0-based indexing). If not provided, applies to all paragraphs."
          }
        },
        "required": ["pattern", "color"]
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.find_and_replace",
      "description": "Finds all occurrences of a specified text pattern and replaces them with another text in the document.",
      "parameters": {
        "type": "object",
        "properties": {
          "pattern": {
            "type": "string",
            "description": "The pattern to match in the document, should be a regular expression"
          },
          "replacement": {
            "type": "string",
            "description": "The text to replace the found text with."
          },
          "paragraph_indices": {
            "type": "array",
            "description": "Optional. Indices of paragraphs to modify (0-based indexing). If not provided, applies to all paragraphs."
          }
        },
        "required": ["pattern", "replacement"]
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.set_font",
      "description": "Changes the font of text in the document or specified paragraphs.",
      "parameters": {
        "type": "object",
        "properties": {
          "font_name": {
            "type": "string",
            "description": "The name of the font to apply (e.g., 'Times New Roman', 'Arial', 'Calibri')"
          },
          "paragraph_indices": {
            "type": "array",
            "description": "Optional. Indices of paragraphs to modify (0-based indexing). If not provided, applies to all paragraphs."
          }
        },
        "required": ["font_name"]
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.set_line_spacing",
      "description": "Sets the line spacing for specified paragraphs in the document.",
      "parameters": {
        "type": "object",
        "properties": {
          "spacing_value": {
            "type": "number",
            "description": "The line spacing value to apply (1.0 for single spacing, 2.0 for double spacing, etc.)."
          },
          "paragraph_indices": {
            "type": "array",
            "description": "Optional. Indices of paragraphs to modify (0-based indexing). If not provided, applies to all paragraphs."
          }
        },
        "required": ["spacing_value"]
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.remove_highlighting",
      "description": "Removes highlighting from text in the document for specified paragraphs.",
      "parameters": {
        "type": "object",
        "properties": {
          "paragraph_indices": {
            "type": "array",
            "description": "Optional. Indices of paragraphs to modify (0-based indexing). If not provided, applies to all paragraphs."
          }
        },
        "required": []
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.find_highlighted_text",
      "description": "Finds all text in the document that has a specific highlight color applied to it.",
      "parameters": {
        "type": "object",
        "properties": {
          "highlight_color": {
            "type": "string",
            "description": "The highlight color to search for. Can be a color name (e.g., 'yellow', 'green') or hex code."
          }
        },
        "required": ["highlight_color"]
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.insert_formula_at_cursor",
      "description": "Inserts a formula at the current cursor position in the document.",
      "parameters": {
        "type": "object",
        "properties": {
          "formula": {
            "type": "string",
            "description": "The formula to insert at the current cursor position."
          }
        },
        "required": ["formula"]
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.insert_image_at_cursor",
      "description": "Inserts an image at the current cursor position in the document.",
      "parameters": {
        "type": "object",
        "properties": {
          "image_path": {
            "type": "string",
            "description": "Full path to the image file to insert"
          },
          "width": {
            "type": "integer",
            "description": "Optional. Width to display the image in pixels. If not specified, uses the original image width."
          },
          "height": {
            "type": "integer",
            "description": "Optional. Height to display the image in pixels. If not specified, uses the original image height."
          }
        },
        "required": ["image_path"]
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.set_strikethrough",
      "description": "Sets the strikethrough formatting for specified text in the document.",
      "parameters": {
        "type": "object",
        "properties": {
          "pattern": {
            "type": "string",
            "description": "The pattern to match in the document, should be a regular expression"
          },
          "paragraph_indices": {
            "type": "array",
            "description": "Optional. Indices of paragraphs to modify (0-based indexing). If not provided, applies to all paragraphs."
          }
        },
        "required": ["pattern"]
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.set_font_size",
      "description": "Changes the font size of specified text in the document.",
      "parameters": {
        "type": "object",
        "properties": {
          "font_size": {
            "type": "number",
            "description": "The font size to apply (in points)."
          },
          "pattern": {
            "type": "string",
            "description": "The pattern to match in the document, should be a regular expression"
          },
          "paragraph_indices": {
            "type": "array",
            "description": "Optional. Indices of paragraphs to modify (0-based indexing). If not provided, applies to all paragraphs."
          }
        },
        "required": ["font_size", "pattern"]
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.export_to_pdf",
      "description": "Exports the current document to PDF format.",
      "parameters": {
        "type": "object",
        "properties": {
          "output_path": {
            "type": "string",
            "description": "Optional. The full path where the PDF should be saved. If not provided, uses the same location as the original document with .pdf extension."
          },
          "output_filename": {
            "type": "string",
            "description": "Optional. The filename to use for the PDF. If not provided, uses the original document's filename with .pdf extension."
          },
          "include_comments": {
            "type": "boolean",
            "description": "Optional. Whether to include comments in the exported PDF. Defaults to false."
          },
          "quality": {
            "type": "string",
            "description": "Optional. The quality of the PDF export ('standard', 'high', 'print'). Defaults to 'standard'."
          }
        },
        "required": []
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.set_paragraph_alignment",
      "description": "Sets the text alignment for specified paragraphs in the document.",
      "parameters": {
        "type": "object",
        "properties": {
          "alignment": {
            "type": "string",
            "description": "The alignment to apply ('left', 'center', 'right', 'justify')."
          },
          "paragraph_indices": {
            "type": "array",
            "description": "Optional. Indices of paragraphs to modify (0-based indexing). If not provided, applies to all paragraphs."
          }
        },
        "required": ["alignment"]
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.capitalize_words",
      "description": "Capitalizes the first letter of each word for specified paragraphs in the document.",
      "parameters": {
        "type": "object",
        "properties": {
          "paragraph_indices": {
            "type": "array",
            "description": "Optional. Indices of paragraphs to modify (0-based indexing). If not provided, applies to all paragraphs."
          }
        },
        "required": []
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.set_default_font",
      "description": "Sets the default font for new text in the document without changing existing text.",
      "parameters": {
        "type": "object",
        "properties": {
          "font_name": {
            "type": "string",
            "description": "The name of the font to set as default (e.g., 'Times New Roman', 'Arial', 'Calibri')"
          },
          "font_size": {
            "type": "number",
            "description": "Optional. The default font size in points."
          }
        },
        "required": ["font_name"]
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.add_page_numbers",
      "description": "Adds page numbers to the document at the specified position.",
      "parameters": {
        "type": "object",
        "properties": {
          "position": {
            "type": "string",
            "description": "Position of the page numbers ('bottom_left', 'bottom_center', 'bottom_right', 'top_left', 'top_center', 'top_right')"
          },
          "start_number": {
            "type": "integer",
            "description": "Optional. The starting page number. Defaults to 1."
          },
          "format": {
            "type": "string",
            "description": "Optional. Format of the page numbers (e.g., '1', 'Page 1', '1 of N'). Defaults to simple number format."
          }
        },
        "required": ["position"]
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.insert_page_break",
      "description": "Inserts a page break at the current cursor position, creating a new blank page after the current one.",
      "parameters": {
        "type": "object",
        "properties": {
          "position": {
            "type": "string",
            "description": "Optional. Specifies where to insert the page break: 'at_cursor' for current cursor position, 'end_of_document' for end of document. Defaults to 'at_cursor'."
          }
        },
        "required": []
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "WriterTools.change_text_case",
      "description": "Changes the case of text in the document or a specified selection.",
      "parameters": {
        "type": "object",
        "properties": {
          "case_type": {
            "type": "string",
            "description": "The type of case conversion to apply ('lowercase', 'uppercase')."
          },
          "pattern": {
            "type": "string",
            "description": "The pattern to match in the document, should be a regular expression"
          },
          "paragraph_indices": {
            "type": "array",
            "description": "Optional. Indices of paragraphs to modify (0-based indexing). If not provided, applies to all paragraphs."
          }
        },
        "required": ["case_type", "pattern"]
      }
    }
  }
]