Skip to content

Commit

Permalink
update tool name
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcheng1982 committed Oct 4, 2024
1 parent cd1d8e9 commit 171a08d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ReadLocalFileTool(private val config: ReadLocalFileConfig?) :
}

override fun name(): String {
return "Read local file"
return toolId
}

private fun getFilePath(request: ReadLocalFileRequest): Path {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ class WriteLocalFileTool(private val config: WriteLocalFileConfig?) :
}

override fun name(): String {
return "Write local file"
return toolId
}

private fun calculateSavePath(request: WriteLocalFileRequest): Path {
val basePath = StringUtils.trimToNull(config?.basePath)
val saveFileDir = Path.of(basePath ?: ".")
Files.createDirectories(saveFileDir)
val filename = StringUtils.trimToNull(request.filename)
return saveFileDir.resolve(filename ?: UUID.randomUUID().toString())
.toAbsolutePath()
Expand Down

0 comments on commit 171a08d

Please sign in to comment.