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