|
6 | 6 | "fmt"
|
7 | 7 |
|
8 | 8 | "github.com/gofiber/fiber/v2"
|
9 |
| - "github.com/gofiber/websocket/v2" |
10 | 9 | "github.com/google/uuid"
|
11 | 10 | "github.com/mudler/LocalAI/core/config"
|
12 | 11 | fiberContext "github.com/mudler/LocalAI/core/http/ctx"
|
@@ -49,24 +48,24 @@ func readRequest(c *fiber.Ctx, cl *config.BackendConfigLoader, ml *model.ModelLo
|
49 | 48 | return modelFile, input, err
|
50 | 49 | }
|
51 | 50 |
|
52 |
| -func readWSRequest(c *websocket.Conn, cl *config.BackendConfigLoader, ml *model.ModelLoader, o *config.ApplicationConfig, firstModel bool) (string, *schema.OpenAIRequest, error) { |
53 |
| - input := new(schema.OpenAIRequest) |
| 51 | +// func readWSRequest(c *websocket.Conn, cl *config.BackendConfigLoader, ml *model.ModelLoader, o *config.ApplicationConfig, firstModel bool) (string, *schema.OpenAIRequest, error) { |
| 52 | +// input := new(schema.OpenAIRequest) |
54 | 53 |
|
55 |
| - input.Model = c.Query("name") |
| 54 | +// input.Model = c.Query("name") |
56 | 55 |
|
57 |
| - received, _ := json.Marshal(input) |
| 56 | +// received, _ := json.Marshal(input) |
58 | 57 |
|
59 |
| - ctx, cancel := context.WithCancel(o.Context) |
| 58 | +// ctx, cancel := context.WithCancel(o.Context) |
60 | 59 |
|
61 |
| - input.Context = ctx |
62 |
| - input.Cancel = cancel |
| 60 | +// input.Context = ctx |
| 61 | +// input.Cancel = cancel |
63 | 62 |
|
64 |
| - log.Debug().Msgf("Request received: %s", string(received)) |
| 63 | +// log.Debug().Msgf("Request received: %s", string(received)) |
65 | 64 |
|
66 |
| - modelFile, err := fiberContext.ModelFromContext(c, cl, ml, input.Model, firstModel) |
| 65 | +// modelFile, err := fiberContext.ModelFromContext(c, cl, ml, input.Model, firstModel) |
67 | 66 |
|
68 |
| - return modelFile, input, err |
69 |
| -} |
| 67 | +// return modelFile, input, err |
| 68 | +// } |
70 | 69 |
|
71 | 70 | func updateRequestConfig(config *config.BackendConfig, input *schema.OpenAIRequest) {
|
72 | 71 | if input.Echo {
|
|
0 commit comments