fix: correct stale symbol names in doc comments (#12139)

Fixes 7 doc comments whose names no longer match their function:
- ToggleStateModelEndpoint (was ToggleModelEndpoint)
- Messages.ToProto (was MessagesToProto)
- NewUserCancellableContext (was newUserCancellableContext)
- CalculateRMS16 (was calculateRMS16)
- NewLocalAIMetricsService + Shutdown TODO (was copied setupOTelSDK)

Supersedes #12084 and #12085 (DCO not signed by contributors).

Assisted-by: MAKI:regolo/glm5.2

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
mudler-agentandEttore Di Giacinto authored and GitHub committed 2026-09-19 23:39:44 +02:00
1 parent 6184a258b3
commit 96ccb8e96c
5 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@ import (
"github.com/mudler/LocalAI/core/services/modeladmin"
)
// ToggleModelEndpoint handles enabling or disabling a model from being loaded on demand.
// ToggleStateModelEndpoint handles enabling or disabling a model from being loaded on demand.
// When disabled, the model remains in the collection but will not be loaded when requested.
//
// @Summary Toggle model enabled/disabled status
+1 -1
View File
@@ -71,7 +71,7 @@ type FunctionCall struct {
type Messages []Message
// MessagesToProto converts schema.Message slice to proto.Message slice
// ToProto converts schema.Message slice to proto.Message slice
// It handles content conversion, tool_calls serialization, and optional fields
func (messages Messages) ToProto() []*proto.Message {
protoMessages := make([]*proto.Message, len(messages))
+1 -1
View File
@@ -522,7 +522,7 @@ func (g *GalleryService) applyCancel(id string, pause bool) {
}
}
// newUserCancellableContext returns a child context whose CancelFunc cancels
// NewUserCancellableContext returns a child context whose CancelFunc cancels
// with the downloader.ErrUserCancelled cause. This lets the download layer
// distinguish a deliberate user cancel (discard the half-downloaded .partial)
// from an incidental cancellation such as process shutdown (keep the .partial
+2 -2
View File
@@ -25,7 +25,7 @@ func (m *LocalAIMetricsService) ObserveAPICall(method string, path string, durat
m.ApiTimeMetric.Record(context.Background(), duration, opts)
}
// setupOTelSDK bootstraps the OpenTelemetry pipeline.
// NewLocalAIMetricsService bootstraps the OpenTelemetry metrics pipeline.
// If it does not return an error, make sure to call shutdown for proper cleanup.
func NewLocalAIMetricsService() (*LocalAIMetricsService, error) {
exporter, err := prometheus.New()
@@ -56,7 +56,7 @@ func NewLocalAIMetricsService() (*LocalAIMetricsService, error) {
func (lams LocalAIMetricsService) Shutdown() error {
// TODO: Not sure how to actually do this:
//// setupOTelSDK bootstraps the OpenTelemetry pipeline.
//// NewLocalAIMetricsService bootstraps the OpenTelemetry metrics pipeline.
//// If it does not return an error, make sure to call shutdown for proper cleanup.
xlog.Warn("LocalAIMetricsService Shutdown called, but OTelSDK proper shutdown not yet implemented?")
+1 -1
View File
@@ -13,7 +13,7 @@ Copyright (c) 2024 Xbozon
*/
// calculateRMS16 calculates the root mean square of the audio buffer for int16 samples.
// CalculateRMS16 calculates the root mean square of the audio buffer for int16 samples.
func CalculateRMS16(buffer []int16) float64 {
var sumSquares float64
for _, sample := range buffer {