Documentation
¶
Overview ¶
Package services provides the implementation of the FileSystemServer, which allows access to files and directories on the local file system.
Index ¶
Constants ¶
View Source
const ( // MaxInlineSize Maximum size for inline content (5MB) MaxInlineSize = 1024 * 1024 * 5 // MaxBase64Size Maximum size for base64 encoding (1MB) MaxBase64Size = 1024 * 1024 * 1 )
View Source
const ( // FileSystemPromptDefault is the default prompt for the file system. FileSystemPromptDefault = `` /* 1385-byte string literal not displayed */ )
View Source
const (
FilesystemServerName comm.MoLingServerType = "FileSystem"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileSystemConfig ¶
type FileSystemConfig struct {
PromptFile string `json:"prompt_file"` // PromptFile is the prompt file for the file system.
AllowedDir string `json:"allowed_dir"` // AllowedDirs is a list of allowed directories. split by comma. e.g. /tmp,/var/tmp
CachePath string `json:"cache_path"` // CachePath is the root path for the file system.
// contains filtered or unexported fields
}
FileSystemConfig represents the configuration for the file system.
func NewFileSystemConfig ¶
func NewFileSystemConfig(path string) *FileSystemConfig
NewFileSystemConfig creates a new FileSystemConfig with the given allowed directories.
func (*FileSystemConfig) Check ¶
func (fc *FileSystemConfig) Check() error
Check validates the allowed directories in the FileSystemConfig.
type FilesystemServer ¶
func (*FilesystemServer) Close ¶
func (fs *FilesystemServer) Close() error
func (*FilesystemServer) Config ¶
func (fs *FilesystemServer) Config() string
Config returns the configuration of the service as a string.
func (*FilesystemServer) Init ¶
func (fs *FilesystemServer) Init() error
func (*FilesystemServer) LoadConfig ¶
func (fs *FilesystemServer) LoadConfig(jsonData map[string]any) error
LoadConfig loads the configuration from a JSON object.
func (*FilesystemServer) Name ¶
func (fs *FilesystemServer) Name() comm.MoLingServerType
Click to show internal directories.
Click to hide internal directories.