Skip to content

Commit ea6ef64

Browse files
committed
refactor
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent 55509d3 commit ea6ef64

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

core/http/endpoints/openai/realtime.go

+7-4
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func newModel(cl *config.BackendConfigLoader, ml *model.ModelLoader, appConfig *
137137
// If we don't have Wrapped model definitions, just return a standard model
138138
opts := backend.ModelOptions(*cfg, appConfig, model.WithBackendString(cfg.Backend),
139139
model.WithModel(cfg.Model))
140-
return ml.BackendLoader(opts...)
140+
return ml.Load(opts...)
141141
}
142142

143143
log.Debug().Msg("Loading a wrapped model")
@@ -174,19 +174,19 @@ func newModel(cl *config.BackendConfigLoader, ml *model.ModelLoader, appConfig *
174174
}
175175

176176
opts := backend.ModelOptions(*cfgTTS, appConfig)
177-
ttsClient, err := ml.BackendLoader(opts...)
177+
ttsClient, err := ml.Load(opts...)
178178
if err != nil {
179179
return nil, fmt.Errorf("failed to load tts model: %w", err)
180180
}
181181

182182
opts = backend.ModelOptions(*cfgSST, appConfig)
183-
transcriptionClient, err := ml.BackendLoader(opts...)
183+
transcriptionClient, err := ml.Load(opts...)
184184
if err != nil {
185185
return nil, fmt.Errorf("failed to load SST model: %w", err)
186186
}
187187

188188
opts = backend.ModelOptions(*cfgLLM, appConfig)
189-
llmClient, err := ml.BackendLoader(opts...)
189+
llmClient, err := ml.Load(opts...)
190190
if err != nil {
191191
return nil, fmt.Errorf("failed to load LLM model: %w", err)
192192
}
@@ -571,6 +571,9 @@ func handleVAD(session *Session, conversation *Conversation, c *websocket.Conn,
571571

572572
// Function to generate a response based on the conversation
573573
func generateResponse(session *Session, conversation *Conversation, responseCreate ResponseCreate, c *websocket.Conn, mt int) {
574+
575+
log.Debug().Msg("Generating realtime response...")
576+
574577
// Compile the conversation history
575578
conversation.Lock.Lock()
576579
var conversationHistory []string

0 commit comments

Comments
 (0)