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
+24 -1
View File
@@ -1,4 +1,5 @@
import os
from google.genai import types
def write_file(working_directory, file_path, content):
abs_path = os.path.abspath(working_directory)
@@ -15,4 +16,26 @@ def write_file(working_directory, file_path, content):
f.write(content)
except Exception as e:
return f"Error: {e}"
return f'Successfully wrote to "{file_path}" ({len(content)} characters written)'
return f'Successfully wrote to "{file_path}" ({len(content)} characters written)'
schema_write_file = types.FunctionDeclaration(
name="write_file",
description="Open file and write content into",
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",
),
"content": types.Schema(
type=types.Type.STRING,
description="Content what should have been written to the file",
),
},
),
)