end of project
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
from functions.config import FILE_LENGTH_LIMIT
|
||||
from google.genai import types
|
||||
|
||||
def get_file_content(working_directory, file_path):
|
||||
abs_working_dir = os.path.abspath(working_directory)
|
||||
@@ -18,3 +19,21 @@ def get_file_content(working_directory, file_path):
|
||||
return content
|
||||
except Exception as e:
|
||||
return f'Error reading file "{file_path}": {e}'
|
||||
|
||||
schema_get_file_content = types.FunctionDeclaration(
|
||||
name="get_file_content",
|
||||
description="Read file contents.",
|
||||
parameters=types.Schema(
|
||||
type=types.Type.OBJECT,
|
||||
properties={
|
||||
"working_directory": types.Schema(
|
||||
type=types.Type.STRING,
|
||||
description="The directory to read the file from. If not provided, lists files in the working directory itself.",
|
||||
),
|
||||
"file_path": types.Schema(
|
||||
type=types.Type.STRING,
|
||||
description="The file to read the content from. If not provided, the function will not work."
|
||||
)
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user