giving functions to use for AI

This commit is contained in:
2025-09-09 09:57:03 +03:00
parent fb424dfa19
commit 3e18a04d55
6 changed files with 116 additions and 6 deletions

View File

@@ -1,6 +1,26 @@
import os
import subprocess
from google.genai import types
schema_run_python_file = types.FunctionDeclaration(
name="run_python_file",
description="Executes a Python file with optional arguments, constrained to the working directory.",
parameters=types.Schema(
type=types.Type.OBJECT,
properties={
"file_path": types.Schema(
type=types.Type.STRING,
description="Path to the Python file, relative to the working directory.",
),
"args": types.Schema(
type=types.Type.ARRAY,
description="List of arguments to pass to the Python script.",
items=types.Schema(type=types.Type.STRING),
),
},
required=["file_path"],
),
)
def run_python_file(working_directory, file_path, args=[]):
try: