mirror of
https://github.com/mudler/LocalAI.git
synced 2026-09-21 05:34:56 -04:00
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:
1 parent
6184a258b3
commit
96ccb8e96c
5 files changed
+6
-6
No files matched your search
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user