From ebf8370689d94fb7f26871822d087eafe508a862 Mon Sep 17 00:00:00 2001 From: Fu Cheng Date: Wed, 8 May 2024 09:49:11 +0800 Subject: [PATCH] use absolute path --- .../llmagentbuilder/tool/readlocalfile/ReadLocalFileTool.kt | 2 +- .../llmagentbuilder/tool/writelocalfile/WriteLocalFileTool.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/read-local-file/src/main/kotlin/io/github/llmagentbuilder/tool/readlocalfile/ReadLocalFileTool.kt b/read-local-file/src/main/kotlin/io/github/llmagentbuilder/tool/readlocalfile/ReadLocalFileTool.kt index 7dd5662..d3e28b7 100644 --- a/read-local-file/src/main/kotlin/io/github/llmagentbuilder/tool/readlocalfile/ReadLocalFileTool.kt +++ b/read-local-file/src/main/kotlin/io/github/llmagentbuilder/tool/readlocalfile/ReadLocalFileTool.kt @@ -40,6 +40,6 @@ class ReadLocalFileTool(private val config: ReadLocalFileConfig) : val basePath = StringUtils.trimToNull(config.basePath)?.let { Paths.get(it) } ?: Paths.get(".") - return basePath.resolve(request.filePath) + return basePath.resolve(request.filePath).toAbsolutePath() } } \ No newline at end of file diff --git a/write-local-file/src/main/kotlin/io/github/llmagentbuilder/tool/writelocalfile/WriteLocalFileTool.kt b/write-local-file/src/main/kotlin/io/github/llmagentbuilder/tool/writelocalfile/WriteLocalFileTool.kt index 1d4e384..22cdb73 100644 --- a/write-local-file/src/main/kotlin/io/github/llmagentbuilder/tool/writelocalfile/WriteLocalFileTool.kt +++ b/write-local-file/src/main/kotlin/io/github/llmagentbuilder/tool/writelocalfile/WriteLocalFileTool.kt @@ -67,5 +67,6 @@ class WriteLocalFileTool(private val config: WriteLocalFileConfig) : ) val filename = StringUtils.trimToNull(request.filename) return saveFileDir.resolve(filename ?: UUID.randomUUID().toString()) + .toAbsolutePath() } } \ No newline at end of file