giving functions to use for AI
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user