From 255748bcba19ebc63ad7e0f4f701ccb027aab481 Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 20 Feb 2024 20:21:19 -0500 Subject: [PATCH] MQTT Startup Refactoring Part 1: core/ packages part 1 (#1728) This PR specifically introduces a `core` folder and moves the following packages over, without any other changes: - `api/backend` - `api/config` - `api/options` - `api/schema` Once this is merged and we confirm there's no regressions, I can migrate over the remaining changes piece by piece to split up application startup, backend services, http, and mqtt as was the goal of the earlier PRs! --- api/localai/backend_monitor.go | 4 ++-- api/localai/gallery.go | 2 +- api/localai/localai.go | 6 +++--- api/openai/chat.go | 8 ++++---- api/openai/completion.go | 8 ++++---- api/openai/edit.go | 8 ++++---- api/openai/embeddings.go | 8 ++++---- api/openai/files.go | 11 ++++++----- api/openai/files_test.go | 11 ++++++----- api/openai/image.go | 8 ++++---- api/openai/inference.go | 8 ++++---- api/openai/list.go | 4 ++-- api/openai/request.go | 6 +++--- api/openai/transcription.go | 6 +++--- backend/go/transcribe/transcript.go | 2 +- backend/go/transcribe/whisper.go | 2 +- {api => core}/backend/embeddings.go | 4 ++-- {api => core}/backend/image.go | 4 ++-- {api => core}/backend/llm.go | 4 ++-- {api => core}/backend/options.go | 4 ++-- {api => core}/backend/transcript.go | 6 +++--- {api => core}/backend/tts.go | 7 +++---- {api => core}/config/config.go | 2 +- {api => core}/config/config_test.go | 6 +++--- {api => core}/config/prediction.go | 2 +- {api => core/http}/api.go | 8 ++++---- {api => core/http}/api_test.go | 6 +++--- {api => core/http}/apt_suite_test.go | 2 +- {api => core}/options/options.go | 0 {api => core}/schema/openai.go | 2 +- {api => core}/schema/whisper.go | 0 main.go | 8 ++++---- pkg/grpc/backend.go | 3 ++- pkg/grpc/base/base.go | 2 +- pkg/grpc/client.go | 2 +- pkg/grpc/embed.go | 5 +++-- pkg/grpc/interface.go | 2 +- tests/integration/reflect_test.go | 2 +- 38 files changed, 93 insertions(+), 90 deletions(-) rename {api => core}/backend/embeddings.go (95%) rename {api => core}/backend/image.go (94%) rename {api => core}/backend/llm.go (97%) rename {api => core}/backend/options.go (97%) rename {api => core}/backend/transcript.go (86%) rename {api => core}/backend/tts.go (90%) rename {api => core}/config/config.go (99%) rename {api => core}/config/config_test.go (93%) rename {api => core}/config/prediction.go (99%) rename {api => core/http}/api.go (98%) rename {api => core/http}/api_test.go (99%) rename {api => core/http}/apt_suite_test.go (90%) rename {api => core}/options/options.go (100%) rename {api => core}/schema/openai.go (98%) rename {api => core}/schema/whisper.go (100%) diff --git a/api/localai/backend_monitor.go b/api/localai/backend_monitor.go index 8cb0bb45ed14..e6f1b409b142 100644 --- a/api/localai/backend_monitor.go +++ b/api/localai/backend_monitor.go @@ -5,10 +5,10 @@ import ( "fmt" "strings" - config "github.com/go-skynet/LocalAI/api/config" + config "github.com/go-skynet/LocalAI/core/config" "github.com/go-skynet/LocalAI/pkg/grpc/proto" - "github.com/go-skynet/LocalAI/api/options" + "github.com/go-skynet/LocalAI/core/options" "github.com/gofiber/fiber/v2" "github.com/rs/zerolog/log" diff --git a/api/localai/gallery.go b/api/localai/gallery.go index a2ad5bd1ac46..ee6f4d7d4a12 100644 --- a/api/localai/gallery.go +++ b/api/localai/gallery.go @@ -11,7 +11,7 @@ import ( json "github.com/json-iterator/go" "gopkg.in/yaml.v3" - config "github.com/go-skynet/LocalAI/api/config" + config "github.com/go-skynet/LocalAI/core/config" "github.com/go-skynet/LocalAI/pkg/gallery" "github.com/go-skynet/LocalAI/pkg/utils" diff --git a/api/localai/localai.go b/api/localai/localai.go index 3abe440ea12e..9d5bbf6c5ca7 100644 --- a/api/localai/localai.go +++ b/api/localai/localai.go @@ -1,12 +1,12 @@ package localai import ( - "github.com/go-skynet/LocalAI/api/backend" - config "github.com/go-skynet/LocalAI/api/config" fiberContext "github.com/go-skynet/LocalAI/api/ctx" + "github.com/go-skynet/LocalAI/core/backend" + config "github.com/go-skynet/LocalAI/core/config" "github.com/rs/zerolog/log" - "github.com/go-skynet/LocalAI/api/options" + "github.com/go-skynet/LocalAI/core/options" "github.com/gofiber/fiber/v2" ) diff --git a/api/openai/chat.go b/api/openai/chat.go index d34f2a0c53ac..78d02f96652e 100644 --- a/api/openai/chat.go +++ b/api/openai/chat.go @@ -8,10 +8,10 @@ import ( "strings" "time" - "github.com/go-skynet/LocalAI/api/backend" - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/options" - "github.com/go-skynet/LocalAI/api/schema" + "github.com/go-skynet/LocalAI/core/backend" + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/options" + "github.com/go-skynet/LocalAI/core/schema" "github.com/go-skynet/LocalAI/pkg/grammar" model "github.com/go-skynet/LocalAI/pkg/model" "github.com/go-skynet/LocalAI/pkg/utils" diff --git a/api/openai/completion.go b/api/openai/completion.go index b098451da199..af56625e324b 100644 --- a/api/openai/completion.go +++ b/api/openai/completion.go @@ -8,10 +8,10 @@ import ( "fmt" "time" - "github.com/go-skynet/LocalAI/api/backend" - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/options" - "github.com/go-skynet/LocalAI/api/schema" + "github.com/go-skynet/LocalAI/core/backend" + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/options" + "github.com/go-skynet/LocalAI/core/schema" "github.com/go-skynet/LocalAI/pkg/grammar" model "github.com/go-skynet/LocalAI/pkg/model" "github.com/gofiber/fiber/v2" diff --git a/api/openai/edit.go b/api/openai/edit.go index 16679ae51fad..56b17920d27a 100644 --- a/api/openai/edit.go +++ b/api/openai/edit.go @@ -5,10 +5,10 @@ import ( "fmt" "time" - "github.com/go-skynet/LocalAI/api/backend" - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/options" - "github.com/go-skynet/LocalAI/api/schema" + "github.com/go-skynet/LocalAI/core/backend" + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/options" + "github.com/go-skynet/LocalAI/core/schema" model "github.com/go-skynet/LocalAI/pkg/model" "github.com/gofiber/fiber/v2" "github.com/google/uuid" diff --git a/api/openai/embeddings.go b/api/openai/embeddings.go index 44feb373d542..198493e1805b 100644 --- a/api/openai/embeddings.go +++ b/api/openai/embeddings.go @@ -5,12 +5,12 @@ import ( "fmt" "time" - "github.com/go-skynet/LocalAI/api/backend" - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/schema" + "github.com/go-skynet/LocalAI/core/backend" + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/schema" "github.com/google/uuid" - "github.com/go-skynet/LocalAI/api/options" + "github.com/go-skynet/LocalAI/core/options" "github.com/gofiber/fiber/v2" "github.com/rs/zerolog/log" ) diff --git a/api/openai/files.go b/api/openai/files.go index f19e79d859f4..57f5c48d4147 100644 --- a/api/openai/files.go +++ b/api/openai/files.go @@ -4,14 +4,15 @@ import ( "encoding/json" "errors" "fmt" - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/options" - "github.com/go-skynet/LocalAI/pkg/utils" - "github.com/gofiber/fiber/v2" - "github.com/rs/zerolog/log" "os" "path/filepath" "time" + + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/options" + "github.com/go-skynet/LocalAI/pkg/utils" + "github.com/gofiber/fiber/v2" + "github.com/rs/zerolog/log" ) var uploadedFiles []File diff --git a/api/openai/files_test.go b/api/openai/files_test.go index cb111b4ac6b9..535cde8ba564 100644 --- a/api/openai/files_test.go +++ b/api/openai/files_test.go @@ -3,11 +3,6 @@ package openai import ( "encoding/json" "fmt" - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/options" - utils2 "github.com/go-skynet/LocalAI/pkg/utils" - "github.com/gofiber/fiber/v2" - "github.com/stretchr/testify/assert" "io" "mime/multipart" "net/http" @@ -16,6 +11,12 @@ import ( "path/filepath" "strings" + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/options" + utils2 "github.com/go-skynet/LocalAI/pkg/utils" + "github.com/gofiber/fiber/v2" + "github.com/stretchr/testify/assert" + "testing" ) diff --git a/api/openai/image.go b/api/openai/image.go index 07f028f013d1..2da6883eb193 100644 --- a/api/openai/image.go +++ b/api/openai/image.go @@ -13,12 +13,12 @@ import ( "strings" "time" - "github.com/go-skynet/LocalAI/api/schema" + "github.com/go-skynet/LocalAI/core/schema" "github.com/google/uuid" - "github.com/go-skynet/LocalAI/api/backend" - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/options" + "github.com/go-skynet/LocalAI/core/backend" + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/options" model "github.com/go-skynet/LocalAI/pkg/model" "github.com/gofiber/fiber/v2" "github.com/rs/zerolog/log" diff --git a/api/openai/inference.go b/api/openai/inference.go index 816c960c3798..184688b27252 100644 --- a/api/openai/inference.go +++ b/api/openai/inference.go @@ -1,10 +1,10 @@ package openai import ( - "github.com/go-skynet/LocalAI/api/backend" - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/options" - "github.com/go-skynet/LocalAI/api/schema" + "github.com/go-skynet/LocalAI/core/backend" + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/options" + "github.com/go-skynet/LocalAI/core/schema" model "github.com/go-skynet/LocalAI/pkg/model" ) diff --git a/api/openai/list.go b/api/openai/list.go index 8bc5bbe22bee..614d5c80e8b1 100644 --- a/api/openai/list.go +++ b/api/openai/list.go @@ -3,8 +3,8 @@ package openai import ( "regexp" - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/schema" + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/schema" model "github.com/go-skynet/LocalAI/pkg/model" "github.com/gofiber/fiber/v2" ) diff --git a/api/openai/request.go b/api/openai/request.go index 6a7a14e8502b..83c41d975f2b 100644 --- a/api/openai/request.go +++ b/api/openai/request.go @@ -9,10 +9,10 @@ import ( "net/http" "strings" - config "github.com/go-skynet/LocalAI/api/config" fiberContext "github.com/go-skynet/LocalAI/api/ctx" - options "github.com/go-skynet/LocalAI/api/options" - "github.com/go-skynet/LocalAI/api/schema" + config "github.com/go-skynet/LocalAI/core/config" + options "github.com/go-skynet/LocalAI/core/options" + "github.com/go-skynet/LocalAI/core/schema" "github.com/go-skynet/LocalAI/pkg/grammar" model "github.com/go-skynet/LocalAI/pkg/model" "github.com/gofiber/fiber/v2" diff --git a/api/openai/transcription.go b/api/openai/transcription.go index 668a20698176..c3fd7d5c83cc 100644 --- a/api/openai/transcription.go +++ b/api/openai/transcription.go @@ -8,9 +8,9 @@ import ( "path" "path/filepath" - "github.com/go-skynet/LocalAI/api/backend" - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/options" + "github.com/go-skynet/LocalAI/core/backend" + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/options" "github.com/gofiber/fiber/v2" "github.com/rs/zerolog/log" diff --git a/backend/go/transcribe/transcript.go b/backend/go/transcribe/transcript.go index ebd43eca6b84..dc331caea988 100644 --- a/backend/go/transcribe/transcript.go +++ b/backend/go/transcribe/transcript.go @@ -8,7 +8,7 @@ import ( "github.com/ggerganov/whisper.cpp/bindings/go/pkg/whisper" "github.com/go-audio/wav" - "github.com/go-skynet/LocalAI/api/schema" + "github.com/go-skynet/LocalAI/core/schema" ) func sh(c string) (string, error) { diff --git a/backend/go/transcribe/whisper.go b/backend/go/transcribe/whisper.go index a033afb0cdbc..ac93be01195b 100644 --- a/backend/go/transcribe/whisper.go +++ b/backend/go/transcribe/whisper.go @@ -4,7 +4,7 @@ package main // It is meant to be used by the main executable that is the server for the specific backend type (falcon, gpt3, etc) import ( "github.com/ggerganov/whisper.cpp/bindings/go/pkg/whisper" - "github.com/go-skynet/LocalAI/api/schema" + "github.com/go-skynet/LocalAI/core/schema" "github.com/go-skynet/LocalAI/pkg/grpc/base" pb "github.com/go-skynet/LocalAI/pkg/grpc/proto" ) diff --git a/api/backend/embeddings.go b/core/backend/embeddings.go similarity index 95% rename from api/backend/embeddings.go rename to core/backend/embeddings.go index 0cf15fea32cf..d8b89e124206 100644 --- a/api/backend/embeddings.go +++ b/core/backend/embeddings.go @@ -3,8 +3,8 @@ package backend import ( "fmt" - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/options" + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/options" "github.com/go-skynet/LocalAI/pkg/grpc" model "github.com/go-skynet/LocalAI/pkg/model" ) diff --git a/api/backend/image.go b/core/backend/image.go similarity index 94% rename from api/backend/image.go rename to core/backend/image.go index 6183269fd3ca..12ea57ceb7dd 100644 --- a/api/backend/image.go +++ b/core/backend/image.go @@ -1,8 +1,8 @@ package backend import ( - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/options" + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/options" "github.com/go-skynet/LocalAI/pkg/grpc/proto" model "github.com/go-skynet/LocalAI/pkg/model" ) diff --git a/api/backend/llm.go b/core/backend/llm.go similarity index 97% rename from api/backend/llm.go rename to core/backend/llm.go index 9e202c53c53b..d1081ad65fc1 100644 --- a/api/backend/llm.go +++ b/core/backend/llm.go @@ -8,8 +8,8 @@ import ( "sync" "unicode/utf8" - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/options" + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/options" "github.com/go-skynet/LocalAI/pkg/gallery" "github.com/go-skynet/LocalAI/pkg/grpc" model "github.com/go-skynet/LocalAI/pkg/model" diff --git a/api/backend/options.go b/core/backend/options.go similarity index 97% rename from api/backend/options.go rename to core/backend/options.go index 38f560688f79..9710ac175d3e 100644 --- a/api/backend/options.go +++ b/core/backend/options.go @@ -7,8 +7,8 @@ import ( pb "github.com/go-skynet/LocalAI/pkg/grpc/proto" model "github.com/go-skynet/LocalAI/pkg/model" - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/options" + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/options" ) func modelOpts(c config.Config, o *options.Option, opts []model.Option) []model.Option { diff --git a/api/backend/transcript.go b/core/backend/transcript.go similarity index 86% rename from api/backend/transcript.go rename to core/backend/transcript.go index 77427839992a..1cbaf8201669 100644 --- a/api/backend/transcript.go +++ b/core/backend/transcript.go @@ -4,10 +4,10 @@ import ( "context" "fmt" - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/schema" + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/schema" - "github.com/go-skynet/LocalAI/api/options" + "github.com/go-skynet/LocalAI/core/options" "github.com/go-skynet/LocalAI/pkg/grpc/proto" model "github.com/go-skynet/LocalAI/pkg/model" ) diff --git a/api/backend/tts.go b/core/backend/tts.go similarity index 90% rename from api/backend/tts.go rename to core/backend/tts.go index 6e5ffcc0c1b1..a9d7153f9348 100644 --- a/api/backend/tts.go +++ b/core/backend/tts.go @@ -6,9 +6,8 @@ import ( "os" "path/filepath" - api_config "github.com/go-skynet/LocalAI/api/config" - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/options" + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/options" "github.com/go-skynet/LocalAI/pkg/grpc/proto" model "github.com/go-skynet/LocalAI/pkg/model" "github.com/go-skynet/LocalAI/pkg/utils" @@ -38,7 +37,7 @@ func ModelTTS(backend, text, modelFile string, loader *model.ModelLoader, o *opt grpcOpts := gRPCModelOpts(c) - opts := modelOpts(api_config.Config{}, o, []model.Option{ + opts := modelOpts(config.Config{}, o, []model.Option{ model.WithBackendString(bb), model.WithModel(modelFile), model.WithContext(o.Context), diff --git a/api/config/config.go b/core/config/config.go similarity index 99% rename from api/config/config.go rename to core/config/config.go index 5ea168281569..af203ecccf14 100644 --- a/api/config/config.go +++ b/core/config/config.go @@ -1,4 +1,4 @@ -package api_config +package config import ( "errors" diff --git a/api/config/config_test.go b/core/config/config_test.go similarity index 93% rename from api/config/config_test.go rename to core/config/config_test.go index 4b00d587eff2..d1e92d5cc41e 100644 --- a/api/config/config_test.go +++ b/core/config/config_test.go @@ -1,10 +1,10 @@ -package api_config_test +package config_test import ( "os" - . "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/options" + . "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/options" "github.com/go-skynet/LocalAI/pkg/model" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" diff --git a/api/config/prediction.go b/core/config/prediction.go similarity index 99% rename from api/config/prediction.go rename to core/config/prediction.go index d2fbb1fa9687..dccb4dfb9f6f 100644 --- a/api/config/prediction.go +++ b/core/config/prediction.go @@ -1,4 +1,4 @@ -package api_config +package config type PredictionOptions struct { diff --git a/api/api.go b/core/http/api.go similarity index 98% rename from api/api.go rename to core/http/api.go index 4442421e650e..7d228152409e 100644 --- a/api/api.go +++ b/core/http/api.go @@ -1,4 +1,4 @@ -package api +package http import ( "encoding/json" @@ -7,11 +7,11 @@ import ( "os" "strings" - config "github.com/go-skynet/LocalAI/api/config" "github.com/go-skynet/LocalAI/api/localai" "github.com/go-skynet/LocalAI/api/openai" - "github.com/go-skynet/LocalAI/api/options" - "github.com/go-skynet/LocalAI/api/schema" + config "github.com/go-skynet/LocalAI/core/config" + "github.com/go-skynet/LocalAI/core/options" + "github.com/go-skynet/LocalAI/core/schema" "github.com/go-skynet/LocalAI/internal" "github.com/go-skynet/LocalAI/metrics" "github.com/go-skynet/LocalAI/pkg/assets" diff --git a/api/api_test.go b/core/http/api_test.go similarity index 99% rename from api/api_test.go rename to core/http/api_test.go index 04d2d6fec02e..9068b393e1a9 100644 --- a/api/api_test.go +++ b/core/http/api_test.go @@ -1,4 +1,4 @@ -package api_test +package http_test import ( "bytes" @@ -13,8 +13,8 @@ import ( "path/filepath" "runtime" - . "github.com/go-skynet/LocalAI/api" - "github.com/go-skynet/LocalAI/api/options" + . "github.com/go-skynet/LocalAI/core/http" + "github.com/go-skynet/LocalAI/core/options" "github.com/go-skynet/LocalAI/metrics" "github.com/go-skynet/LocalAI/pkg/downloader" "github.com/go-skynet/LocalAI/pkg/gallery" diff --git a/api/apt_suite_test.go b/core/http/apt_suite_test.go similarity index 90% rename from api/apt_suite_test.go rename to core/http/apt_suite_test.go index e3c15c048b14..0269a97321df 100644 --- a/api/apt_suite_test.go +++ b/core/http/apt_suite_test.go @@ -1,4 +1,4 @@ -package api_test +package http_test import ( "testing" diff --git a/api/options/options.go b/core/options/options.go similarity index 100% rename from api/options/options.go rename to core/options/options.go diff --git a/api/schema/openai.go b/core/schema/openai.go similarity index 98% rename from api/schema/openai.go rename to core/schema/openai.go index 12a39b4284de..23abd7b76c46 100644 --- a/api/schema/openai.go +++ b/core/schema/openai.go @@ -3,7 +3,7 @@ package schema import ( "context" - config "github.com/go-skynet/LocalAI/api/config" + config "github.com/go-skynet/LocalAI/core/config" "github.com/go-skynet/LocalAI/pkg/grammar" ) diff --git a/api/schema/whisper.go b/core/schema/whisper.go similarity index 100% rename from api/schema/whisper.go rename to core/schema/whisper.go diff --git a/main.go b/main.go index 2636b4026e9d..7e4262ee57bd 100644 --- a/main.go +++ b/main.go @@ -12,10 +12,10 @@ import ( "syscall" "time" - api "github.com/go-skynet/LocalAI/api" - "github.com/go-skynet/LocalAI/api/backend" - config "github.com/go-skynet/LocalAI/api/config" - "github.com/go-skynet/LocalAI/api/options" + "github.com/go-skynet/LocalAI/core/backend" + config "github.com/go-skynet/LocalAI/core/config" + api "github.com/go-skynet/LocalAI/core/http" + "github.com/go-skynet/LocalAI/core/options" "github.com/go-skynet/LocalAI/internal" "github.com/go-skynet/LocalAI/metrics" "github.com/go-skynet/LocalAI/pkg/gallery" diff --git a/pkg/grpc/backend.go b/pkg/grpc/backend.go index ae8ffc5fe714..22933d584a07 100644 --- a/pkg/grpc/backend.go +++ b/pkg/grpc/backend.go @@ -2,7 +2,8 @@ package grpc import ( "context" - "github.com/go-skynet/LocalAI/api/schema" + + "github.com/go-skynet/LocalAI/core/schema" pb "github.com/go-skynet/LocalAI/pkg/grpc/proto" "google.golang.org/grpc" ) diff --git a/pkg/grpc/base/base.go b/pkg/grpc/base/base.go index 739d1cbbe6bb..89c8785e6b8c 100644 --- a/pkg/grpc/base/base.go +++ b/pkg/grpc/base/base.go @@ -6,7 +6,7 @@ import ( "fmt" "os" - "github.com/go-skynet/LocalAI/api/schema" + "github.com/go-skynet/LocalAI/core/schema" pb "github.com/go-skynet/LocalAI/pkg/grpc/proto" gopsutil "github.com/shirou/gopsutil/v3/process" ) diff --git a/pkg/grpc/client.go b/pkg/grpc/client.go index 5e97ea73e068..9058db05e018 100644 --- a/pkg/grpc/client.go +++ b/pkg/grpc/client.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "github.com/go-skynet/LocalAI/api/schema" + "github.com/go-skynet/LocalAI/core/schema" pb "github.com/go-skynet/LocalAI/pkg/grpc/proto" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" diff --git a/pkg/grpc/embed.go b/pkg/grpc/embed.go index b9ab551f63c3..228b1df56bef 100644 --- a/pkg/grpc/embed.go +++ b/pkg/grpc/embed.go @@ -2,11 +2,12 @@ package grpc import ( "context" - "github.com/go-skynet/LocalAI/api/schema" + "time" + + "github.com/go-skynet/LocalAI/core/schema" pb "github.com/go-skynet/LocalAI/pkg/grpc/proto" "google.golang.org/grpc" "google.golang.org/grpc/metadata" - "time" ) var _ Backend = new(embedBackend) diff --git a/pkg/grpc/interface.go b/pkg/grpc/interface.go index a76261c15ce9..1cc7cb3d8762 100644 --- a/pkg/grpc/interface.go +++ b/pkg/grpc/interface.go @@ -1,7 +1,7 @@ package grpc import ( - "github.com/go-skynet/LocalAI/api/schema" + "github.com/go-skynet/LocalAI/core/schema" pb "github.com/go-skynet/LocalAI/pkg/grpc/proto" ) diff --git a/tests/integration/reflect_test.go b/tests/integration/reflect_test.go index c0fe7096a1d8..bf3f8a5bc1ac 100644 --- a/tests/integration/reflect_test.go +++ b/tests/integration/reflect_test.go @@ -3,7 +3,7 @@ package integration_test import ( "reflect" - config "github.com/go-skynet/LocalAI/api/config" + config "github.com/go-skynet/LocalAI/core/config" model "github.com/go-skynet/LocalAI/pkg/model" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega"