Add 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>
This commit is contained in:
Adam Yanxiao Zhao
2025-08-17 12:08:40 +08:00
committed by GitHub
parent c833d03a4b
commit aa05f6cc26
26 changed files with 8657 additions and 23 deletions

View File

@@ -0,0 +1,3 @@
from .func import generate_func
__all__ = ["generate_func"]

View File

@@ -0,0 +1,260 @@
[
{
"type": "function",
"function": {
"name": "CodeTools.launch_vscode",
"description": "Launches Visual Studio Code with the specified file path or directory",
"parameters": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The file path or directory to open in VS Code"
}
},
"required": [
"path"
]
}
}
},
{
"type": "function",
"function": {
"name": "CodeTools.compare_files",
"description": "Compares two files in VSCode",
"parameters": {
"type": "object",
"properties": {
"file1": {
"type": "string",
"description": "The path to the first file"
},
"file2": {
"type": "string",
"description": "The path to the second file"
}
},
"required": [
"file1",
"file2"
]
}
}
},
{
"type": "function",
"function": {
"name": "CodeTools.add_folder",
"description": "Adds a folder to the last active window in VSCode",
"parameters": {
"type": "object",
"properties": {
"folder": {
"type": "string",
"description": "The folder path to add"
}
},
"required": [
"folder"
]
}
}
},
{
"type": "function",
"function": {
"name": "CodeTools.goto_file",
"description": "Opens a file at a specific line and character position",
"parameters": {
"type": "object",
"properties": {
"file_path": {
"type": "string",
"description": "The file path to open"
},
"line": {
"type": "integer",
"description": "The line number to navigate to",
"default": 1
},
"character": {
"type": "integer",
"description": "The character position to navigate to",
"default": 1
}
},
"required": [
"file_path"
]
}
}
},
{
"type": "function",
"function": {
"name": "CodeTools.perform_merge",
"description": "Perform a three-way merge",
"parameters": {
"type": "object",
"properties": {
"path1": {
"type": "string",
"description": "The path to the first version file"
},
"path2": {
"type": "string",
"description": "The path to the second version file"
},
"base": {
"type": "string",
"description": "The path to the base version file"
},
"result": {
"type": "string",
"description": "The path to save the merged result"
}
},
"required": [
"path1",
"path2",
"base",
"result"
]
}
}
},
{
"type": "function",
"function": {
"name": "CodeTools.remove_folder",
"description": "Removes a folder from the last active window in VSCode",
"parameters": {
"type": "object",
"properties": {
"folder": {
"type": "string",
"description": "The folder path to remove"
}
},
"required": [
"folder"
]
}
}
},
{
"type": "function",
"function": {
"name": "CodeTools.install_extension",
"description": "Installs an extension or updates it in VSCode",
"parameters": {
"type": "object",
"properties": {
"extension_id": {
"type": "string",
"description": "The identifier of the extension"
},
"pre_release": {
"type": "boolean",
"description": "Whether to install the pre-release version",
"default": false
}
},
"required": [
"extension_id"
]
}
}
},
{
"type": "function",
"function": {
"name": "CodeTools.uninstall_extension",
"description": "Uninstalls an extension from VSCode",
"parameters": {
"type": "object",
"properties": {
"extension_id": {
"type": "string",
"description": "The identifier of the extension"
}
},
"required": [
"extension_id"
]
}
}
},
{
"type": "function",
"function": {
"name": "CodeTools.list_extensions",
"description": "Lists installed extensions in VSCode",
"parameters": {
"type": "object",
"properties": {
"show_versions": {
"type": "boolean",
"description": "Whether to show extension versions",
"default": false
},
"category": {
"type": "string",
"description": "The category to filter extensions by"
}
}
}
}
},
{
"type": "function",
"function": {
"name": "CodeTools.update_extensions",
"description": "Updates all installed extensions in VSCode to the latest version",
"parameters": {
"type": "object",
"properties": {}
}
}
},
{
"type": "function",
"function": {
"name": "CodeTools.disable_extension",
"description": "Disables a specific extension for the next instance of VSCode",
"parameters": {
"type": "object",
"properties": {
"extension_id": {
"type": "string",
"description": "The identifier of the extension"
}
},
"required": [
"extension_id"
]
}
}
},
{
"type": "function",
"function": {
"name": "CodeTools.toggle_sync",
"description": "Toggles synchronization on or off in VSCode",
"parameters": {
"type": "object",
"properties": {
"state": {
"type": "string",
"description": "The state to set ('on' or 'off')",
"enum": ["on", "off"]
}
},
"required": [
"state"
]
}
}
}
]

View File

@@ -0,0 +1,117 @@
def generate_func(json_data):
# 收集所有类名和它们的函数
class_funcs = {}
no_class_funcs = []
for item in json_data:
if item["type"] == "function":
func = item["function"]
func_parts = func["name"].split(".")
if len(func_parts) == 2:
class_name, func_name = func_parts
if class_name not in class_funcs:
class_funcs[class_name] = []
class_funcs[class_name].append(item)
else:
no_class_funcs.append(item)
code = ""
# 生成有类的函数
for class_name, funcs in class_funcs.items():
code += f"class {class_name}:\n"
for item in funcs:
func = item["function"]
func_name = func["name"].split(".")[-1]
description = func["description"]
params = func["parameters"]["properties"]
required = func["parameters"].get("required", [])
# 构建参数列表
param_list = ["cls"]
# 首先添加必需参数
for param_name in required:
param_list.append(f"{param_name}")
# 然后添加可选参数
for param_name in params:
if param_name not in required:
param_list.append(f"{param_name}") # 可选参数默认值设为None
# 构建函数定义
func_def = f" def {func_name}({', '.join(param_list)}):\n"
# 构建文档字符串
docstring = f' """\n {description}\n\n Args:\n'
if len(param_list) == 1: # 只有cls参数
docstring += " None\n"
else:
# 首先记录必需参数
for param_name in required:
param_type = params[param_name]["type"]
param_desc = params[param_name].get("description", "")
docstring += f" {param_name} ({param_type}): {param_desc}\n"
# 然后记录可选参数
for param_name in params:
if param_name not in required:
param_type = params[param_name]["type"]
param_desc = params[param_name].get("description", "")
docstring += f" {param_name} ({param_type}, optional): {param_desc}\n"
docstring += ' """\n'
code += func_def + docstring + "\n"
code += "\n"
# 生成没有类的函数
for item in no_class_funcs:
func = item["function"]
func_name = func["name"]
description = func["description"]
params = func["parameters"]["properties"]
required = func["parameters"].get("required", [])
# 构建参数列表
param_list = []
# 首先添加必需参数
for param_name in required:
param_list.append(f"{param_name}")
# 然后添加可选参数
for param_name in params:
if param_name not in required:
param_list.append(f"{param_name}")
# 构建函数定义
func_def = f"def {func_name}({', '.join(param_list)}):\n"
# 构建文档字符串
docstring = f' """\n {description}\n\n Args:\n'
if not param_list:
docstring += " None\n"
else:
# 首先记录必需参数
for param_name in required:
param_type = params[param_name]["type"]
param_desc = params[param_name].get("description", "")
docstring += f" {param_name} ({param_type}): {param_desc}\n"
# 然后记录可选参数
for param_name in params:
if param_name not in required:
param_type = params[param_name]["type"]
param_desc = params[param_name].get("description", "")
docstring += f" {param_name} ({param_type}, optional): {param_desc}\n"
docstring += ' """\n'
code += func_def + docstring + "\n"
return code.strip()
if __name__ == "__main__":
import json
with open("libreoffice_calc.json", "r") as f:
json_data = json.load(f)
print(generate_func(json_data))

View File

@@ -0,0 +1,134 @@
[
{
"type": "function",
"function": {
"name": "BrowserTools.open_profile_settings",
"description": "Opens the profile settings page in the browser.",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "BrowserTools.open_password_settings",
"description": "Opens the password/autofill settings page in the browser.",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "BrowserTools.open_privacy_settings",
"description": "Opens the privacy settings page in the browser.",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "BrowserTools.open_appearance_settings",
"description": "Opens the appearance settings page in the browser.",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "BrowserTools.open_search_engine_settings",
"description": "Opens the search engine settings page in the browser.",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "BrowserTools.bring_back_last_tab",
"description": "Restores the last-closed tab in the browser (equivalent to Ctrl+Shift+T).",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "BrowserTools.print",
"description": "Opens the print dialog for the current browser page (equivalent to Ctrl+P).",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "BrowserTools.delete_browsing_data",
"description": "Opens the 'Clear browsing data' dialog in the browser (equivalent to Ctrl+Shift+Del).",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "BrowserTools.open_extensions",
"description": "Opens the extensions management page in the browser.",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "BrowserTools.bookmark_page",
"description": "Bookmarks the current page in the browser (equivalent to Ctrl+D).",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "BrowserTools.open_bookmarks",
"description": "Opens the bookmarks page in the browser.",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
}
]

View File

@@ -0,0 +1,634 @@
[
{
"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"
]
}
}
}
]

View File

@@ -0,0 +1,569 @@
[
{
"type": "function",
"function": {
"name": "ImpressTools.save",
"description": "Save the current presentation to its current location",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.go_to_slide",
"description": "Navigates to a specific slide in the presentation based on its index.",
"parameters": {
"type": "object",
"properties": {
"slide_index": {
"type": "integer",
"description": "The index of the slide to navigate to (1-based indexing)"
}
},
"required": ["slide_index"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.get_slide_count",
"description": "Gets the total number of slides in the current presentation.",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.duplicate_slide",
"description": "Creates a duplicate of a specific slide and places it at the end of the presentation.",
"parameters": {
"type": "object",
"properties": {
"slide_index": {
"type": "integer",
"description": "The index of the slide to duplicate (1-based indexing)"
}
},
"required": ["slide_index"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.set_slide_font",
"description": "Sets the font style for all text elements in a specific slide.",
"parameters": {
"type": "object",
"properties": {
"slide_index": {
"type": "integer",
"description": "The index of the slide to modify (1-based indexing)"
},
"font_name": {
"type": "string",
"description": "The name of the font to apply (e.g., 'Arial', 'Times New Roman', 'Calibri')"
}
},
"required": ["slide_index", "font_name"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.write_text",
"description": "writes text to a specific textbox on a slide",
"parameters": {
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "The text content of the note to add"
},
"page_index": {
"type": "integer",
"description": "The index of the slide to add a note to (1-based indexing)"
},
"box_index": {
"type": "integer",
"description": "The index of the textbox to modify (0-based indexing)"
},
"bold": {
"type": "boolean",
"description": "Whether to make the text bold, default is false"
},
"italic": {
"type": "boolean",
"description": "Whether to make the text italic, default is false"
},
"size": {
"type": "integer",
"description": "The size of the text. If None, uses the box's current font size."
},
"append": {
"type": "boolean",
"description": "Whether to append the text, default is False. If you want to observe some formats(like a bullet at the beginning) or keep the original text, you should set up it."
}
},
"required": ["content", "page_index", "box_index"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.set_style",
"description": "Sets the style properties for the specified textbox on a slide.",
"parameters": {
"type": "object",
"properties": {
"slide_index": {
"type": "integer",
"description": "The index of the slide to modify (1-based indexing)"
},
"box_index": {
"type": "integer",
"description": "The index of the textbox to modify (0-based indexing)"
},
"bold": {
"type": "boolean",
"description": "Whether to make the title text bold"
},
"italic": {
"type": "boolean",
"description": "Whether to make the title text italic"
},
"underline": {
"type": "boolean",
"description": "Whether to underline the title text"
}
},
"required": ["slide_index", "box_index"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.configure_auto_save",
"description": "Enables or disables auto-save functionality for the current document and sets the auto-save interval.",
"parameters": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether to enable (true) or disable (false) auto-save"
},
"interval_minutes": {
"type": "number",
"description": "The interval in minutes between auto-saves (minimum 1 minute)"
}
},
"required": ["enabled", "interval_minutes"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.set_background_color",
"description": "Sets the background color for the specified textbox on a slide.",
"parameters": {
"type": "object",
"properties": {
"slide_index": {
"type": "integer",
"description": "The index of the slide containing the textbox (1-based indexing)"
},
"box_index": {
"type": "integer",
"description": "The index of the textbox to modify (0-based indexing)"
},
"color": {
"type": "string",
"description": "The color to apply to the textbox (e.g., 'red', 'green', 'blue', 'yellow', or hex color code)"
}
},
"required": ["slide_index", "box_index", "color"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.set_text_color",
"description": "Sets the text color for the specified textbox on a slide.",
"parameters": {
"type": "object",
"properties": {
"slide_index": {
"type": "integer",
"description": "The index of the slide to modify (1-based indexing)"
},
"box_index": {
"type": "integer",
"description": "The index of the textbox to modify (0-based indexing)"
},
"color": {
"type": "string",
"description": "The color to apply to the title text (e.g., 'red', 'green', 'blue', 'black', or hex color code)"
}
},
"required": ["slide_index", "box_index", "color"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.delete_content",
"description": "Deletes the specified textbox from a slide.",
"parameters": {
"type": "object",
"properties": {
"slide_index": {
"type": "integer",
"description": "The index of the slide to modify (1-based indexing)"
},
"box_index": {
"type": "integer",
"description": "The index of the textbox to modify (0-based indexing)"
}
},
"required": ["slide_index", "box_index"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.set_slide_orientation",
"description": "Changes the orientation of slides in the presentation between portrait (upright) and landscape (sideways).",
"parameters": {
"type": "object",
"properties": {
"orientation": {
"type": "string",
"description": "The desired orientation for the slides",
"enum": ["portrait", "landscape"]
}
},
"required": ["orientation"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.position_box",
"description": "Positions a textbox or image on a slide at a specific location or predefined position.",
"parameters": {
"type": "object",
"properties": {
"slide_index": {
"type": "integer",
"description": "The index of the slide containing the box (1-based indexing)"
},
"box_index": {
"type": "integer",
"description": "The index of the box to position (0-based indexing)"
},
"position": {
"type": "string",
"description": "Predefined position on the slide (left, right, center, top, bottom)",
"enum": [
"left",
"right",
"center",
"top",
"bottom",
"top-left",
"top-right",
"bottom-left",
"bottom-right"
]
}
},
"required": ["slide_index", "box_index", "position"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.insert_file",
"description": "Inserts a video or audio file into the current or specified slide in the presentation.",
"parameters": {
"type": "object",
"properties": {
"file_path": {
"type": "string",
"description": "The full path to the file to be inserted"
},
"slide_index": {
"type": "integer",
"description": "The index of the slide to insert the file into (1-based indexing). If not provided, inserts into the current slide."
},
"position": {
"type": "object",
"description": "The position coordinates for the file",
"properties": {
"x": {
"type": "number",
"description": "The x-coordinate (horizontal position) as a percentage of slide width"
},
"y": {
"type": "number",
"description": "The y-coordinate (vertical position) as a percentage of slide height"
}
}
},
"size": {
"type": "object",
"description": "The size dimensions for the file",
"properties": {
"width": {
"type": "number",
"description": "The width as a percentage of slide width"
},
"height": {
"type": "number",
"description": "The height as a percentage of slide height"
}
}
},
"autoplay": {
"type": "boolean",
"description": "Whether the video or audio should automatically play when the slide is shown"
}
},
"required": ["file_path"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.set_slide_background",
"description": "Sets the background color or image for a specific slide or all slides.",
"parameters": {
"type": "object",
"properties": {
"slide_index": {
"type": "integer",
"description": "The index of the slide to modify (1-based indexing). If not provided, applies to all slides."
},
"color": {
"type": "string",
"description": "The background color to apply (e.g., 'red', 'green', 'blue', or hex color code)"
},
"image_path": {
"type": "string",
"description": "Path to an image file to use as background. If provided, overrides color."
}
},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.save_as",
"description": "Saves the current document to a specified location with a given filename.",
"parameters": {
"type": "object",
"properties": {
"file_path": {
"type": "string",
"description": "The full path where the file should be saved, including the filename and extension"
},
"overwrite": {
"type": "boolean",
"description": "Whether to overwrite the file if it already exists (default: false)"
}
},
"required": ["file_path"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.insert_image",
"description": "Inserts an image to a specific slide in the presentation.",
"parameters": {
"type": "object",
"properties": {
"slide_index": {
"type": "integer",
"description": "The index of the slide to add the image to (1-based indexing)"
},
"image_path": {
"type": "string",
"description": "The full path to the image file to be added"
},
"width": {
"type": "number",
"description": "The width of the image in centimeters"
},
"height": {
"type": "number",
"description": "The height of the image in centimeters"
},
"position": {
"type": "object",
"description": "The position coordinates for the image",
"properties": {
"x": {
"type": "number",
"description": "The x-coordinate (horizontal position) as a percentage of slide width"
},
"y": {
"type": "number",
"description": "The y-coordinate (vertical position) as a percentage of slide height"
}
}
}
},
"required": ["slide_index", "image_path"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.configure_display_settings",
"description": "Configures the display settings for LibreOffice Impress presentations, including monitor usage and presenter view options.",
"parameters": {
"type": "object",
"properties": {
"use_presenter_view": {
"type": "boolean",
"description": "Whether to use presenter view (showing current and next slide on one screen). Set to false to disable presenter view."
},
"primary_monitor_only": {
"type": "boolean",
"description": "Whether to use only the primary monitor for the presentation. Set to true to use only one screen."
},
"monitor_for_presentation": {
"type": "integer",
"description": "Specify which monitor to use for the presentation (1 for primary monitor, 2 for secondary monitor, etc.)"
}
},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.set_slide_number_color",
"description": "Sets the color of the slide number in the presentation.",
"parameters": {
"type": "object",
"properties": {
"color": {
"type": "string",
"description": "The color to apply to slide numbers (e.g., 'red', 'green', 'blue', 'black', or hex color code)"
}
},
"required": ["color"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.set_text_strikethrough",
"description": "Applies or removes strike-through formatting to specific text content in a slide.",
"parameters": {
"type": "object",
"properties": {
"slide_index": {
"type": "integer",
"description": "The index of the slide containing the text (1-based indexing)"
},
"box_index": {
"type": "integer",
"description": "The index of the textbox containing the text (0-based indexing)"
},
"line_numbers": {
"type": "array",
"items": {
"type": "integer"
},
"description": "The line numbers to apply strike-through formatting to (1-based indexing)"
},
"apply": {
"type": "boolean",
"description": "Whether to apply (true) or remove (false) strike-through formatting"
}
},
"required": ["slide_index", "box_index", "line_numbers", "apply"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.set_textbox_alignment",
"description": "Sets the text alignment for the specified textbox on a slide.",
"parameters": {
"type": "object",
"properties": {
"slide_index": {
"type": "integer",
"description": "The index of the slide to modify (1-based indexing)"
},
"box_index": {
"type": "integer",
"description": "The index of the textbox to modify (0-based indexing)"
},
"alignment": {
"type": "string",
"description": "The text alignment to apply to the title",
"enum": ["left", "center", "right", "justify"]
}
},
"required": ["slide_index", "box_index", "alignment"]
}
}
},
{
"type": "function",
"function": {
"name": "ImpressTools.export_to_image",
"description": "Exports the current presentation or a specific slide to an image file format (PNG, JPEG, etc.).",
"parameters": {
"type": "object",
"properties": {
"file_path": {
"type": "string",
"description": "The full path where the image file should be saved, including the filename and extension"
},
"format": {
"type": "string",
"description": "The image format to export to (e.g., 'png', 'jpeg', 'gif')",
"enum": ["png", "jpeg", "jpg", "gif", "bmp", "tiff"]
},
"slide_index": {
"type": "integer",
"description": "The index of the specific slide to export (1-based indexing). If not provided, exports the entire presentation as a series of images."
}
},
"required": ["file_path", "format"]
}
}
}
]

View File

@@ -0,0 +1,412 @@
[
{
"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"]
}
}
}
]

View File

@@ -0,0 +1,171 @@
[
{
"type": "function",
"function": {
"name": "VLCTools.get_playlist",
"description": "Gets the current VLC playlist with track information including name, URI and duration.",
"parameters": {
"type": "object",
"properties": {}
}
}
},
{
"type": "function",
"function": {
"name": "VLCTools.play",
"description": "Starts playing the current media in VLC player.",
"parameters": {
"type": "object",
"properties": {}
}
}
},
{
"type": "function",
"function": {
"name": "VLCTools.pause",
"description": "Pauses the currently playing media in VLC player.",
"parameters": {
"type": "object",
"properties": {}
}
}
},
{
"type": "function",
"function": {
"name": "VLCTools.next",
"description": "Switches to the next media item in the VLC playlist.",
"parameters": {
"type": "object",
"properties": {}
}
}
},
{
"type": "function",
"function": {
"name": "VLCTools.previous",
"description": "Switches to the previous media item in the VLC playlist.",
"parameters": {
"type": "object",
"properties": {}
}
}
},
{
"type": "function",
"function": {
"name": "VLCTools.add_to_playlist",
"description": "Adds a media file to the VLC playlist.",
"parameters": {
"type": "object",
"properties": {
"uri": {
"type": "string",
"description": "The URI of the media file to add to the playlist, start with 'file://' or 'https://'"
}
},
"required": ["uri"]
}
}
},
{
"type": "function",
"function": {
"name": "VLCTools.get_current_time",
"description": "Gets the current playback time position of the playing media in seconds.",
"parameters": {
"type": "object",
"properties": {}
}
}
},
{
"type": "function",
"function": {
"name": "VLCTools.get_media_duration",
"description": "Gets the total duration of the currently playing media file in seconds.",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "VLCTools.toggle_fullscreen",
"description": "Toggles fullscreen mode for the currently playing video in the media player. If the video is not in fullscreen mode, it will be expanded to fill the entire screen. If it's already in fullscreen mode, it will return to windowed mode.",
"parameters": {
"type": "object",
"properties": {
"enable": {
"type": "boolean",
"description": "Optional parameter to explicitly set fullscreen mode. If true, forces fullscreen mode. If false, exits fullscreen mode. If not provided, the current state is toggled."
}
},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "VLCTools.get_settings",
"description": "Gets the current settings of the VLC player.",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
},
{
"type": "function",
"function": {
"name": "VLCTools.set_settings",
"description": "Sets the settings for the VLC player.",
"parameters": {
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "The name of the setting to set. i.e. input-record-path: the path to the recording folder, qt-bgcone: disable/enable splash cone icon (in 0/1), qt-max-volume: set max volume (in number), qt-minimal-view: hide/show bottom toolbar (in 0/1), global-key-play-pause: disable/enable play&pause key (in 0/1)"
},
"value": {
"type": "string",
"description": "The value to set for the specified setting, set 0/1 for boolean values"
}
},
"required": [
"field",
"value"
]
}
}
},
{
"type": "function",
"function": {
"name": "VLCTools.get_media_files",
"description": "Gets the media files for the specified path.",
"parameters": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The path to the media files"
},
"suffix": {
"type": "array",
"description": "The suffix of the media files, default is ['mp4', 'avi', 'mkv', 'mov', 'mp3', 'm4a', 'wav']"
}
},
"required": ["path"]
}
}
}
]