add the rest of schemas, update prompts
This commit is contained in:
@@ -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",
|
||||
),
|
||||
},
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user