chore(knowledgebase): clean collection names (no spaces,no uppercase) (#385)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
committed by
GitHub
parent
ec3f302cdf
commit
cfdefcd075
@@ -13,6 +13,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/mudler/LocalAGI/core/agent"
|
"github.com/mudler/LocalAGI/core/agent"
|
||||||
@@ -26,7 +27,8 @@ type WrappedClient struct {
|
|||||||
collection string
|
collection string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewWrappedClient(baseURL, apiKey, collection string) *WrappedClient {
|
func NewWrappedClient(baseURL, apiKey, c string) *WrappedClient {
|
||||||
|
collection := strings.TrimSpace(strings.ToLower(c))
|
||||||
wc := &WrappedClient{
|
wc := &WrappedClient{
|
||||||
Client: NewClient(baseURL, apiKey),
|
Client: NewClient(baseURL, apiKey),
|
||||||
collection: collection,
|
collection: collection,
|
||||||
|
|||||||
Reference in New Issue
Block a user