add the rest of schemas, update prompts

This commit is contained in:
2026-03-28 17:45:23 +01:00
parent 84196b582f
commit b3d068edf9
5 changed files with 82 additions and 5 deletions
+25 -1
View File
@@ -1,5 +1,6 @@
import os
import subprocess
from google.genai import types
def run_python_file(working_directory, file_path, args=None):
try:
@@ -36,4 +37,27 @@ def run_python_file(working_directory, file_path, args=None):
output.append(f"STDERR: {completed_process.stderr}")
return "\n".join(output)
except Exception as e:
return f"Error: executing Python file: {e}"
return f"Error: executing Python file: {e}"
schema_run_python_file = types.FunctionDeclaration(
name="run_python_file",
description="Run the file provided in the path",
parameters=types.Schema(
type=types.Type.OBJECT,
properties={
"working_directory": types.Schema(
type=types.Type.STRING,
description="Directory path to list files from, relative to the working directory (default is the working directory itself)",
),
"file_path": types.Schema(
type=types.Type.STRING,
description="File path",
),
"args": types.Schema(
type=types.Type.ARRAY,
items=types.Schema(type=types.Type.STRING),
description="Optional arguments to run subprocess",
),
},
),
)