Skip to content

Commit cfdefcd

Browse files
authored
chore(knowledgebase): clean collection names (no spaces,no uppercase) (#385)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent ec3f302 commit cfdefcd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/localrag/client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"net/http"
1414
"os"
1515
"path/filepath"
16+
"strings"
1617
"time"
1718

1819
"github.com/mudler/LocalAGI/core/agent"
@@ -26,7 +27,8 @@ type WrappedClient struct {
2627
collection string
2728
}
2829

29-
func NewWrappedClient(baseURL, apiKey, collection string) *WrappedClient {
30+
func NewWrappedClient(baseURL, apiKey, c string) *WrappedClient {
31+
collection := strings.TrimSpace(strings.ToLower(c))
3032
wc := &WrappedClient{
3133
Client: NewClient(baseURL, apiKey),
3234
collection: collection,

0 commit comments

Comments
 (0)