mirrored 15 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": "CalcTools.get_workbook_info",
            "description": "Get workbook information, including file path, file name, sheets and active sheet.",
            "parameters": {
                "type": "object",
                "properties": {},
                "required": []
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.save",
            "description": "Save the current workbook to its current location",
            "parameters": {
                "type": "object",
                "properties": {},
                "required": []
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.get_column_data",
            "description": "Get all data from the specified column.",
            "parameters": {
                "type": "object",
                "properties": {
                    "column_name": {
                        "type": "string",
                        "description": "Name of the column to read (e.g. 'A', 'B', etc.)"
                    }
                },
                "required": [
                    "column_name"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.switch_active_sheet",
            "description": "Switch to the specified sheet and make it active. Creates new sheet if it doesn't exist.",
            "parameters": {
                "type": "object",
                "properties": {
                    "sheet_name": {
                        "type": "string",
                        "description": "Name of the sheet to switch to or create"
                    }
                },
                "required": [
                    "sheet_name"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.set_column_values",
            "description": "Set values to the specified column, cannot be used to set formulas.",
            "parameters": {
                "type": "object",
                "properties": {
                    "column_name": {
                        "type": "string",
                        "description": "Name of the column (e.g. 'A', 'B', etc.) to write to"
                    },
                    "data": {
                        "type": "array",
                        "description": "List of values to write to the column"
                    },
                    "start_index": {
                        "type": "integer",
                        "description": "The index of the first row to write to, default is 2 (skip the first row)"
                    }
                },
                "required": [
                    "column_name",
                    "data"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.highlight_range",
            "description": "Highlight the specified range with the specified color.",
            "parameters": {
                "type": "object",
                "properties": {
                    "range_str": {
                        "type": "string",
                        "description": "Range to highlight, in the format of 'A1:B10'"
                    },
                    "color": {
                        "type": "integer",
                        "description": "Color to highlight with, default is 0xFF0000 (red)"
                    }
                },
                "required": [
                    "range_str"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.transpose_range",
            "description": "Transpose the specified range and paste it to the target cell.",
            "parameters": {
                "type": "object",
                "properties": {
                    "source_range": {
                        "type": "string",
                        "description": "Range to transpose, in the format of 'A1:B10'"
                    },
                    "target_cell": {
                        "type": "string",
                        "description": "Target cell to paste the transposed data, in the format of 'A1'"
                    }
                },
                "required": [
                    "source_range",
                    "target_cell"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.export_to_csv",
            "description": "Export the current document to a CSV file with the same path and name as the original file.",
            "parameters": {
                "type": "object",
                "properties": {},
                "required": []
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.sort_column",
            "description": "Sort the data in the specified column in ascending or descending order.",
            "parameters": {
                "type": "object",
                "properties": {
                    "column_name": {
                        "type": "string",
                        "description": "The name of the column to sort (e.g. 'A', 'B', etc.)"
                    },
                    "ascending": {
                        "type": "boolean",
                        "description": "Whether to sort in ascending order (default True)"
                    },
                    "start_index": {
                        "type": "integer",
                        "description": "The index of the first row to sort, default is 2 (skip the first row)"
                    }
                },
                "required": [
                    "column_name"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.set_validation_list",
            "description": "Set a validation list for the specified column.",
            "parameters": {
                "type": "object",
                "properties": {
                    "column_name": {
                        "type": "string",
                        "description": "The name of the column (e.g. 'A', 'B', etc.) to set the validation list for"
                    },
                    "values": {
                        "type": "array",
                        "description": "The list of values to use for the validation list"
                    }
                },
                "required": [
                    "column_name",
                    "values"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.hide_row_data",
            "description": "Hide rows that contain the specified value.",
            "parameters": {
                "type": "object",
                "properties": {
                    "value": {
                        "type": "string",
                        "description": "The value to hide rows for, default is 'N/A'"
                    }
                },
                "required": []
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.reorder_columns",
            "description": "Reorder the columns in the sheet according to the specified order.",
            "parameters": {
                "type": "object",
                "properties": {
                    "column_order": {
                        "type": "array",
                        "description": "A list of column names in the desired order (e.g. ['A', 'B', 'C'])"
                    }
                },
                "required": [
                    "column_order"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.create_pivot_table",
            "description": "Create a pivot table in the active worksheet based on data from the source sheet.",
            "parameters": {
                "type": "object",
                "properties": {
                    "source_sheet": {
                        "type": "string",
                        "description": "Name of the source sheet containing the data"
                    },
                    "table_name": {
                        "type": "string",
                        "description": "Name for the new pivot table"
                    },
                    "row_fields": {
                        "type": "array",
                        "description": "List of fields to use as row labels (e.g. ['A', 'B', 'C'])"
                    },
                    "col_fields": {
                        "type": "array",
                        "description": "List of fields to use as column labels (e.g. ['A', 'B', 'C'])"
                    },
                    "value_fields": {
                        "type": "array",
                        "description": "List of fields to use as values (e.g. ['A', 'B', 'C'])"
                    },
                    "aggregation_function": {
                        "type": "string",
                        "description": "Aggregation function to use (sum, count, average, min, max), default is 'sum'"
                    },
                    "target_cell": {
                        "type": "string",
                        "description": "Target cell for the pivot table, default is 'A1'"
                    }
                },
                "required": [
                    "source_sheet",
                    "table_name",
                    "value_fields"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.merge_cells",
            "description": "Merge cells in the specified range.",
            "parameters": {
                "type": "object",
                "properties": {
                    "range_str": {
                        "type": "string",
                        "description": "Range of cells to merge, in format 'A1:B10'"
                    }
                },
                "required": [
                    "range_str"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.set_cell_value",
            "description": "Set a value to a specific cell in the active worksheet.",
            "parameters": {
                "type": "object",
                "properties": {
                    "cell": {
                        "type": "string",
                        "description": "Cell reference (e.g., 'A1')"
                    },
                    "value": {
                        "type": "string",
                        "description": "Value to set in the cell"
                    }
                },
                "required": [
                    "cell",
                    "value"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.format_range",
            "description": "Apply formatting to the specified range in the active worksheet.",
            "parameters": {
                "type": "object",
                "properties": {
                    "range_str": {
                        "type": "string",
                        "description": "Range to format, in the format of 'A1:B10'"
                    },
                    "background_color": {
                        "type": "string",
                        "description": "Background color in hex format (e.g., '#0000ff')"
                    },
                    "font_color": {
                        "type": "string",
                        "description": "Font color in hex format (e.g., '#ffffff')"
                    },
                    "bold": {
                        "type": "boolean",
                        "description": "Whether to make the text bold"
                    },
                    "alignment": {
                        "type": "string",
                        "description": "Text alignment (left, center, right)"
                    }
                },
                "required": [
                    "range_str"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.create_chart",
            "description": "Create a chart in the active worksheet based on the specified data range.",
            "parameters": {
                "type": "object",
                "properties": {
                    "chart_type": {
                        "type": "string",
                        "description": "Type of chart (bar, column, line, pie, scatter, area)"
                    },
                    "data_range": {
                        "type": "string",
                        "description": "Range containing the data for the chart, in the format of 'A1:B10'"
                    },
                    "title": {
                        "type": "string",
                        "description": "Title for the chart"
                    },
                    "x_axis_title": {
                        "type": "string",
                        "description": "Title for the X axis"
                    },
                    "y_axis_title": {
                        "type": "string",
                        "description": "Title for the Y axis"
                    }
                },
                "required": [
                    "chart_type",
                    "data_range"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.freeze_panes",
            "description": "Freeze rows and/or columns in the active worksheet.",
            "parameters": {
                "type": "object",
                "properties": {
                    "rows": {
                        "type": "integer",
                        "description": "Number of rows to freeze from the top"
                    },
                    "columns": {
                        "type": "integer",
                        "description": "Number of columns to freeze from the left"
                    }
                },
                "required": []
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.rename_sheet",
            "description": "Rename a worksheet in the workbook.",
            "parameters": {
                "type": "object",
                "properties": {
                    "old_name": {
                        "type": "string",
                        "description": "Current name of the worksheet"
                    },
                    "new_name": {
                        "type": "string",
                        "description": "New name for the worksheet"
                    }
                },
                "required": [
                    "old_name",
                    "new_name"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.copy_sheet",
            "description": "Create a copy of an existing worksheet in the workbook.",
            "parameters": {
                "type": "object",
                "properties": {
                    "source_sheet": {
                        "type": "string",
                        "description": "Name of the worksheet to copy"
                    },
                    "new_sheet_name": {
                        "type": "string",
                        "description": "Name for the new worksheet copy (optional)"
                    }
                },
                "required": [
                    "source_sheet"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.reorder_sheets",
            "description": "Change the order of worksheets in the workbook.",
            "parameters": {
                "type": "object",
                "properties": {
                    "sheet_name": {
                        "type": "string",
                        "description": "Name of the worksheet to move"
                    },
                    "position": {
                        "type": "integer",
                        "description": "New position index (0-based) for the worksheet"
                    }
                },
                "required": [
                    "sheet_name",
                    "position"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.set_chart_legend_position",
            "description": "Set the position of the legend in a chart.",
            "parameters": {
                "type": "object",
                "properties": {
                    "position": {
                        "type": "string",
                        "description": "Position of the legend (top, bottom, left, right, none)"
                    }
                },
                "required": [
                    "position"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.set_number_format",
            "description": "Apply a specific number format to a range of cells.",
            "parameters": {
                "type": "object",
                "properties": {
                    "range_str": {
                        "type": "string",
                        "description": "Range to format, in the format of 'A1:B10'"
                    },
                    "format_type": {
                        "type": "string",
                        "description": "Type of number format (general, number, currency, accounting, date, time, percentage, fraction, scientific, text)"
                    },
                    "decimal_places": {
                        "type": "integer",
                        "description": "Number of decimal places to display (optional)"
                    }
                },
                "required": [
                    "range_str",
                    "format_type"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.adjust_column_width",
            "description": "Adjust the width of specified columns.",
            "parameters": {
                "type": "object",
                "properties": {
                    "columns": {
                        "type": "string",
                        "description": "Column range to adjust (e.g., 'A:C')"
                    },
                    "width": {
                        "type": "number",
                        "description": "Width to set (in characters)"
                    },
                    "autofit": {
                        "type": "boolean",
                        "description": "Whether to autofit columns to content"
                    }
                },
                "required": [
                    "columns"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.adjust_row_height",
            "description": "Adjust the height of specified rows.",
            "parameters": {
                "type": "object",
                "properties": {
                    "rows": {
                        "type": "string",
                        "description": "Row range to adjust (e.g., '1:10')"
                    },
                    "height": {
                        "type": "number",
                        "description": "Height to set (in points)"
                    },
                    "autofit": {
                        "type": "boolean",
                        "description": "Whether to autofit rows to content"
                    }
                },
                "required": [
                    "rows"
                ]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.export_to_pdf",
            "description": "Export the current document or specified sheets to PDF.",
            "parameters": {
                "type": "object",
                "properties": {
                    "file_path": {
                        "type": "string",
                        "description": "Path where to save the PDF file, default is the same path as the original file"
                    },
                    "sheets": {
                        "type": "array",
                        "description": "List of sheet names to include in PDF, default is all sheets"
                    },
                    "open_after_export": {
                        "type": "boolean",
                        "description": "Whether to open the PDF after export, default is False"
                    }
                },
                "required": []
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "CalcTools.set_zoom_level",
            "description": "Adjust the zoom level of the current worksheet.",
            "parameters": {
                "type": "object",
                "properties": {
                    "zoom_percentage": {
                        "type": "integer",
                        "description": "Zoom level as a percentage (e.g., 75 for 75%, 100 for normal size, 150 for zoomed in). Valid range is typically 10-400."
                    }
                },
                "required": [
                    "zoom_percentage"
                ]
            }
        }
    }
]