Skip to content

Commit 73ecb7f

Browse files
authored
chore: drop assistants endpoint (#5926)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent 053bed6 commit 73ecb7f

File tree

10 files changed

+1
-1600
lines changed

10 files changed

+1
-1600
lines changed

core/cli/run.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ type RunCMD struct {
2525
ModelsPath string `env:"LOCALAI_MODELS_PATH,MODELS_PATH" type:"path" default:"${basepath}/models" help:"Path containing models used for inferencing" group:"storage"`
2626
GeneratedContentPath string `env:"LOCALAI_GENERATED_CONTENT_PATH,GENERATED_CONTENT_PATH" type:"path" default:"/tmp/generated/content" help:"Location for generated content (e.g. images, audio, videos)" group:"storage"`
2727
UploadPath string `env:"LOCALAI_UPLOAD_PATH,UPLOAD_PATH" type:"path" default:"/tmp/localai/upload" help:"Path to store uploads from files api" group:"storage"`
28-
ConfigPath string `env:"LOCALAI_CONFIG_PATH,CONFIG_PATH" default:"/tmp/localai/config" group:"storage"`
2928
LocalaiConfigDir string `env:"LOCALAI_CONFIG_DIR" type:"path" default:"${basepath}/configuration" help:"Directory for dynamic loading of certain configuration files (currently api_keys.json and external_backends.json)" group:"storage"`
3029
LocalaiConfigDirPollInterval time.Duration `env:"LOCALAI_CONFIG_DIR_POLL_INTERVAL" help:"Typically the config path picks up changes automatically, but if your system has broken fsnotify events, set this to an interval to poll the LocalAI Config Dir (example: 1m)" group:"storage"`
3130
// The alias on this option is there to preserve functionality with the old `--config-file` parameter
@@ -88,7 +87,6 @@ func (r *RunCMD) Run(ctx *cliContext.Context) error {
8887
config.WithDebug(zerolog.GlobalLevel() <= zerolog.DebugLevel),
8988
config.WithGeneratedContentDir(r.GeneratedContentPath),
9089
config.WithUploadDir(r.UploadPath),
91-
config.WithConfigsDir(r.ConfigPath),
9290
config.WithDynamicConfigDir(r.LocalaiConfigDir),
9391
config.WithDynamicConfigDirPollInterval(r.LocalaiConfigDirPollInterval),
9492
config.WithF16(r.F16),

core/config/application_config.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ type ApplicationConfig struct {
2121
Debug bool
2222
GeneratedContentDir string
2323

24-
ConfigsDir string
25-
UploadDir string
24+
UploadDir string
2625

2726
DynamicConfigsDir string
2827
DynamicConfigsDirPollInterval time.Duration
@@ -302,12 +301,6 @@ func WithUploadDir(uploadDir string) AppOption {
302301
}
303302
}
304303

305-
func WithConfigsDir(configsDir string) AppOption {
306-
return func(o *ApplicationConfig) {
307-
o.ConfigsDir = configsDir
308-
}
309-
}
310-
311304
func WithDynamicConfigDir(dynamicConfigsDir string) AppOption {
312305
return func(o *ApplicationConfig) {
313306
o.DynamicConfigsDir = dynamicConfigsDir

core/http/app.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ import (
1010

1111
"github.com/dave-gray101/v2keyauth"
1212
"github.com/gofiber/websocket/v2"
13-
"github.com/mudler/LocalAI/pkg/utils"
1413

1514
"github.com/mudler/LocalAI/core/http/endpoints/localai"
16-
"github.com/mudler/LocalAI/core/http/endpoints/openai"
1715
"github.com/mudler/LocalAI/core/http/middleware"
1816
"github.com/mudler/LocalAI/core/http/routes"
1917

@@ -199,11 +197,6 @@ func API(application *application.Application) (*fiber.App, error) {
199197
router.Use(csrf.New())
200198
}
201199

202-
// Load config jsons
203-
utils.LoadConfig(application.ApplicationConfig().UploadDir, openai.UploadedFilesFile, &openai.UploadedFiles)
204-
utils.LoadConfig(application.ApplicationConfig().ConfigsDir, openai.AssistantsConfigFile, &openai.Assistants)
205-
utils.LoadConfig(application.ApplicationConfig().ConfigsDir, openai.AssistantsFileConfigFile, &openai.AssistantFiles)
206-
207200
galleryService := services.NewGalleryService(application.ApplicationConfig(), application.ModelLoader())
208201
err = galleryService.Start(application.ApplicationConfig().Context, application.BackendLoader())
209202
if err != nil {

0 commit comments

Comments
 (0)